Great tutorial, thanks! However, it is not very clear to me how come that the list of visible todos gets updated when user adds a new todo. Seems like a real magic to me. How does the TodoApp learn about the updated todos?
We have specified, the todos array as an @observable. Whenever we make any changes to an @observable; the components decorated with @observer will autorun/rerun the render method.
Similarly, with @computed, whenever an @observable changes; the functions decorated with @computed are run, which get the required properties from the@observable data, and they compute the derivations, as required... and that's how we get visibleTodos.
If you're interested to know more, check out the MobX docs. They're very well written.