Skip to content

compare state and prevState #85

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

Closed
TrySound opened this issue May 27, 2016 · 6 comments
Closed

compare state and prevState #85

TrySound opened this issue May 27, 2016 · 6 comments
Milestone

Comments

@TrySound
Copy link

There is an optimization in react-redux which compares previous and current state and do not make slice if they are equal. Is it possible to introduce this optimization in ng-redux?

@wbuchwalter
Copy link
Member

wbuchwalter commented May 27, 2016

Yes, I don't see why not.
Do you have a scenario where this optimization would be useful?
I have a hard time picturing slicing as a bottleneck (unless you have 1 mapStateToProps for the whole application, or that kind of bad practice maybe).

@TrySound
Copy link
Author

TrySound commented May 27, 2016

@wbuchwalter One of my cases is something like selecting already selected item, which shoudn't update state and force recalculating slice of same data.

@wbuchwalter
Copy link
Member

My question was more about trying to figure out a scenario where what you said would actually cause perf issues.

But anyway, yes it should be easily doable.

On Fri, May 27, 2016 at 5:47 AM -0700, "Bogdan Chadkin" notifications@github.com wrote:

@wbuchwalter A case is something like selecting already selected item, which shoudn't update state and force recalculating slice of same data.


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@TrySound
Copy link
Author

There is not so big perf issue, but still props recalculating in tens components could be prevented, this will save a bit of memory I think.

@TrySound
Copy link
Author

TrySound commented May 27, 2016

Also nothing will work if somebody will forget to "immutate" store, which can force to follow the most important rule of redux.

@AntJanus AntJanus mentioned this issue Jan 8, 2018
9 tasks
@AntJanus
Copy link
Collaborator

AntJanus commented Jan 8, 2018

Added to 4.1.0 roadmap

@AntJanus AntJanus added this to the 4.1.0 milestone Jan 8, 2018
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

4 participants