-
Notifications
You must be signed in to change notification settings - Fork 28
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
Avoid store state updates if nothing changed #30
Comments
I already started working on it and have a couple of updates pending... |
updated POST_STORE_RESOURCE and PATCH_STORE_RESOURCE to detect if no changes where applied.
a first update is committed. something better than Object.assign would be great that those this automatically. |
Do you mean you want to replace all the |
which one do you mean? I was looking for something that works like Object.assign({}, values1, values2) but returns values1 if values2 does not result in any further changes. Kind of a "Object.immutableAssign" Goal would be to avoid manual equals checks and automatically return the old state if no changes were applied. Naturally it would not be to difficult to implement that manually if it not covered by lodash or something. |
I see what you mean now, no I don't know about the existence of such function. It is good to have it. |
If you want to implement this, you may find useful the new object spread feature in TypeScript 2.1, see https://blog.mariusschulz.com/2016/12/23/typescript-2-1-object-rest-and-spread |
I have a look if a can come up with something. Will be back at work on tuesday. |
e.g. POST_STORE_RESOURCE should not update the store if there is no change.
The text was updated successfully, but these errors were encountered: