Reputation: 1282
I see two options:
#1 observable_array.replace() ?
or
#2 observable_array=[ ] ?
Any suggestion will be appreciated?
Upvotes: 1
Views: 1645
Reputation: 15345
You should favor the first according to the documentation
The problem with overriding the array is that you will lose the observable
property if you don't override the observable array with a new observable array.
In the end, when setting an observable array, mobx observes changes for each entry of the array, not changes on the array object itself.
Upvotes: 1