diegohaz / diegohaz/arc

[redux] Entities/resource pattern with redux-saga-thunk

Open
#273 3 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
JavaScript
Stars
2.9k
Forks
289
PR merge metrics
No merged PRs in 30d

Description

From the redux-saga-thunk docs:
```
store.dispatch(resourceCreateRequest({ title: 'foo' })).then((detail) => {
// detail is the action payload property
console.log('Yaay!', detail)
}).catch((error) => {
// error is the action payload property
console.log('Oops!', error)
})
```

I'm using the entities/resource pattern outlined in this repo and it seems that `detail` above is always the id of the resource I am creating/updating. I'm assuming this is so it works with the entities/normalizr pattern? Is there any way to have it return the actual entity object or get access to it somehow from within the resource dispatch promise? I am using resource dispatches a lot in redux-form onSubmits.

Thank you

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the redux-saga-thunk documentation example and the entities/resource pattern referenced in the issue. Reproduce the resourceCreateRequest promise behavior, then trace how its resolved payload is selected during create and update dispatches. Done means the expected entity access or return behavior is implemented and covered by the relevant tests or documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, redux
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.