- Action takes a function, and returns a function with exactly the same signature.
- action makes the distinction between actions (something that modifies the state) and reactions (the state needs to trigger a side effect automatically) very clear.
- MobX has made a point to stay un-opinionated about how you chose to write your actions.
- In strict mode, MobX will throw an exception on any attempt to modify state outside an action.
- Well, for starters, action wraps your original function automatically in a transaction .
Read the full article, click here.
@ReactiveConf: “MobX 2.2: explicit actions, controlled mutations and improved DX: #ReactJS”
MobX had an amazing few weeks! It has just hit 2000 stars on GitHub. There’s been tremendous interest from the React Amsterdam talk (video…
MobX 2.2: explicit actions, controlled mutations and improved DX — Medium