Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow passing an array to createSuccess and updateSuccess #57

Open
GuillaumeJasmin opened this issue May 18, 2017 · 3 comments
Open

Allow passing an array to createSuccess and updateSuccess #57

GuillaumeJasmin opened this issue May 18, 2017 · 3 comments

Comments

@GuillaumeJasmin
Copy link
Contributor

GuillaumeJasmin commented May 18, 2017

Hi,

It's currently impossible to use an array of data with createSuccess() or updateSuccess().
I would like to do this:
createSuccess(data) with data as an array. Same for updateSuccess().
I get an error when I try to insert an array instead of an object, it works only for fetchSuccess().

I work with batch update on my server, and I need to insert the results list without use updateSuccess() many times, because if I have 20 rows, I have to do 20 dispatch(), so 20 UI updates. Very bad for performances.

Is there going to be a future update for this ?

Thanks :)

@jsherbert
Copy link

+1, but in lieu of a PR, if you're struggling for performance there are packages that allow you to combine actions to avoid UI updates, e.g. redux-batched-actions.

@GuillaumeJasmin
Copy link
Contributor Author

GuillaumeJasmin commented May 19, 2017

Oh thanks ! Yes it's a good alternative, I will use that.

However it would be very nice to have a future enhancement for batch update feature, even if it's not high priority because there is an alternative as you specified.

Thanks ! :)

@GuillaumeJasmin GuillaumeJasmin changed the title Bulk update and create using an array instead of object Batch update and create using an array instead of object May 19, 2017
@sporto
Copy link
Contributor

sporto commented May 21, 2017

This sounds like a useful feature. Hopefully someone would like to make a PR.

@sporto sporto changed the title Batch update and create using an array instead of object Allow passing an array to createSuccess and updateSuccess May 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants