jamesplease / redux-resource

3kb resource management for Redux
https://redux-resource.js.org
MIT License
237 stars 28 forks source link

meta with request action #416

Closed GuillaumeJasmin closed 6 years ago

GuillaumeJasmin commented 6 years ago

Hi :) It seems to be impossible to set meta on UPDATE_RESOURCES_SUCCEEDED, like:

{
  type: 'UPDATE_RESOURCES_SUCCEEDED',
  resources: [...]
  meta: {
    foo: true
  }
}

because meta seems overrided by request status, like { updateStatus: 'succeeded' }, instead of be merged, like this:

{
  updateStatus: 'succeeded',
  foo: true,
}

I start an update, commit here: https://github.com/GuillaumeJasmin/redux-resource/commit/d9640cb0f20a4c5bc488ae840e9fc59856ccee09

It's works for me. Do I make a pull request ? Or it's too early and there is others checks required ? (units test not done yet)

jamesplease commented 6 years ago

Related: https://github.com/jamesplease/redux-resource/issues/263 , #336

I’ve wanted this for some time. My only hesitation is that it could be a breaking change, so I was thinking of adding support for it with the new request action types described in #336 .

GuillaumeJasmin commented 6 years ago

Good ! So I close this issue. Multi-operation requests will be a very nice feature, because it's could be very usefull and it also will uniform request actions format with local action format

weyert commented 5 years ago

I am having the same problem. What's the best way to solve this?

jamesplease commented 5 years ago

Using the sync action types is the recommended way to do this, for now. There is a planned set of improved async actions, but they have not yet been introduced into the library.

GuillaumeJasmin commented 5 years ago

I published a fork release few months ago with this feature. commit: https://github.com/GuillaumeJasmin/redux-resource/commit/d9640cb0f20a4c5bc488ae840e9fc59856ccee09 package release: @guillaumejasmin/redux-resource