What's the difference between @computed
and @action
in MobX?
They both are functions, so what is difference between them?
@computed is used when the function will 'compute' the return value from existing information.
@action is used for functions that will change to the existing information (state), and prompts 'observers' to access the latest version of the relevant 'observable(s)'.