Setting same value using set function in Record is creating a new object
Setting same value using set function in Record is creating a new object
I am using Immutable Record in ReduceStore to avoid emmitting the change in case of there there is no data change. Even for the same data, Immutable.js creating new object and ReduceStore areEqual function return false and emit the changes.
I am using following structure
const Rec = Immutable.Record({
status: Immutable.List()
});
and setting an same element in status
const rec2 = rec.set('status', Immutable.List(status));
in above snippet, staus is recieved from the action and it is similar to existing status value in the state.
Below is the codepen which shows the issue I am facing :
https://codepen.io/anon/pen/vrvKaw?editors=1111
Please help me if it is possible or my understanding of getting the same object for the same values is wrong.
Thanks for help in advance.
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Comments
Post a Comment