@action('[USER] ADD')
useStrict(true)
transaction(() => {
action1();
action2();
});
observable({})
@observable
class Store {
@observable collection1 = []
@observable.ref collection2 = []
@observable.shallow collection3 = []
}
const todos = [{ test: "value }]
const store = new Store()
store.collection1 = todos;
store.collection2 = todos;
store.collection3 = todos;
store.collection1 === todos
FAUX
store.collection1[0] === todos[0]
FAUX
store.collection2 === todos
VRAI
store.collection2[0] === todos[0]
VRAI
store.collection3 === todos
FAUX
store.collection3[0] === todos[0]
VRAI
npm i --save mobx mobx-angular
import MobxAngularModule
... or...
npm i --save mobx
mobxAngularDebug(true)
trace() (or whyRun())
Have a nice beer.