diegohaz / redux-saga-thunk

Dispatching an action handled by redux-saga returns promise
MIT License
221 stars 17 forks source link

Return more than just detail? #28

Closed Geczy closed 6 years ago

Geczy commented 6 years ago

I need more data than just the id from a promise response

How can I do that?

diegohaz commented 6 years ago

Hi, @Geczy.

Anything you put into payload will be returned in the promise. So you can just pass all the data you need.

Geczy commented 6 years ago

That is true, but I'm using it with your atomic redux api and the ecosystem there just expects an id from the response, detail. I was hoping I could return from the thunk something like:

.then(detail, fullPayload) to be backwards compatible with your api library

diegohaz commented 6 years ago

Got it. In that case, you should update the example resource module so as to return more data.

I guess you can use selectors from the entities module within resource module sagas.

I'm going to close this since it's out of the scope of this library.