-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
question on immutable in production #476
Comments
This means that if you developed with |
@Yomguithereal thanks. So here is the follow up from my understanding:
Essentially, I should not mutate the data get from baobab tree directly, rather use update api provided by baobab. Correct? Thanks. |
That's correct. The fact is if you try to mutate the objects given by the tree with |
@Yomguithereal Thanks. Another followup question: const tree = new Baobab({ hello: { world: 123 }, apple: { pie: 456} });
const initialState = tree.get();
tree.set('hello', { world: 123 });
console.log(initialState === tree.get());
console.log(initialState.hello === tree.get('hello'));
console.log(initialState.apple === tree.get('apple')); For the sample code above, I tried to set the value of tree using the same Is this expected behavior of baobab or we didn't take care of this case? Thanks. |
a followup finding: |
Yes, this behavior is to be expected because |
in the readme regarding immutable, it reads
What does this mean by
should be disabled in production
? Do we need to do anything specifically for production?Thanks
The text was updated successfully, but these errors were encountered: