-
Good lucky everyone! const App = types
.model({
test: t.frozen({}), // working!
// test: types.model({}), // doesn't working oops...
})
.actions(self => ({
setTest(newTest: any = {}) {
self.test = newTest;
},
})); When I call the action yet, I can modify the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Lol. This is because MobX only tracked with definite properties, so that when I need a data structure as like followed: interface DS {
[key: string]: number;
} MobX can't observed it or I should say MST doesn't support it where use by |
Beta Was this translation helpful? Give feedback.
Lol. This is because MobX only tracked with definite properties, so that when I need a data structure as like followed:
MobX can't observed it or I should say MST doesn't support it where use by
types.model
. Of course I can viatypes.frozen<Record<string, number>>({})
to mark types and observed the observable.