useStrict
is a method to open strict mode in dob.
1
| import { useStrict } from "dob"
|
Usage
Strict Mode
It’s not allow to change any observable value out of Action
:
1 2 3 4 5 6 7 8
| useStrict()
const obj = observable() obj.title = "bob"
Action(() => { obj.title = "bob" })
|
ESNext Usage
Action
with decorator usage.
1 2 3 4 5 6 7 8 9 10 11
| useStrict()
class SomeStore {}
class SomeAction { @inject(SomeStore) store
@Action methodTwo() { this.store.title = "bob" } }
|
cancelStrict
To cancle strict mode.
1 2
| import { cancelStrict } from "dob" cancelStrict()
|