Action
is to reduce the number of dependency tracking triggers, it can collect all changes, and then merge trigger.
1 | import { Action } from "dob" |
Features
1 | import { observe, observable, Action } from 'dob' |
There are three changes can be seen merged.
ESNext usage
1 | someAction() { |
In StrictMode
Changes only allowed run in Action
in the strictMode
.
note: async
await
seems like synchronization, in fact, is asynchronous, so it’s necessary to pay attention to the following wording:
1 | @Action async someAction() { |
the code after await
row, will be in a separate stack to run, that is, not in the current Action.