You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am new to Mobx, just want to know why we need use @observable inside model.
I think they are redundant because we already use @observable inside TodoStore.ts.
export class TodoStore {
......
@observable
public todos: Array<TodoModel>;
......
I have tried remove @observable from the model, the application still work
The text was updated successfully, but these errors were encountered:
You're right. it doesn't need to observable on TodoModel's member property (since it only uses todos array), but when you need to change existing todo model's value, it will be required.
Here is
TodoModel.ts
:I am new to Mobx, just want to know why we need use
@observable
inside model.I think they are redundant because we already use
@observable
insideTodoStore.ts
.I have tried remove
@observable
from the model, the application still workThe text was updated successfully, but these errors were encountered: