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

redux-immer: one time only produce. #2775

Closed
salvoravida opened this issue Oct 11, 2019 · 4 comments
Closed

redux-immer: one time only produce. #2775

salvoravida opened this issue Oct 11, 2019 · 4 comments

Comments

@salvoravida
Copy link

salvoravida commented Oct 11, 2019

Is your feature request related to a problem? Please describe.
no

Describe the solution you'd like
improve performance and use standard reducers

Describe alternatives you've considered
nothing

Additional context
https://github.com/salvoravida/redux-immer

Hi, i want to suggest redux-immer:
redux-immer is used to create an equivalent function of Redux combineReducers that works with immer state. Like redux-immutable but for immer

Features:
*one time only produce
*standard reducers

If you think it is a good idea, i could work on a PR.
Salvo

@gretzky
Copy link
Member

gretzky commented Oct 15, 2019

Please fill out the template with a more in-depth description of what you want to see and how you would implement it.

@gretzky gretzky closed this as completed Oct 15, 2019
@julienben
Copy link
Member

I like the idea that this removes code but:

  • Do we want to completely hide immer and the produce function? I feel like that's a step too far. You might forget that you're using the draft and that it doesn't work exactly the same as if you were actually mutating your state.
  • The generators are there to write this code for you anyway.
  • This library isn't tested.

@salvoravida
Copy link
Author

@julienben i agree that redux-immer will hide produce and draft, but you have cleaner code in every reducer and more important it will invoke one time only "produce"

that said it's your choice. thank you for your answer.

@lock
Copy link

lock bot commented Nov 14, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Nov 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants