We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The first
var detailInfo = observable({}); var res = { code: 200, data: { employee: 'GisMan' }, message: "SUCCESS" } detailInfo = res; console.log(detailInfo);
the result is:
then:
constructor(props) { super(props); extendObservable(this, {detailInfo: {}}); this.detailInfo = { code: 200, data: { employee: 'GisMan' }, message: "SUCCESS" }; console.log(this.detailInfo); }
or ues dereactor '@observable' in ES.Next
but the detailInfo is:
detailInfo
These two are very easy to cause confusion.
In fact, itself is not observable,only properties will be observable
observable
more deatil
The text was updated successfully, but these errors were encountered:
detail
Sorry, something went wrong.
autorun is dynamic computed
see the snippe code
const {observable, autorun, toJS} = mobx; var a = observable(0); var b = observable(1); var c = observable(2); autorun(() => { if (a.get() === 0) { console.log('b', toJS(b)); } else { console.log('c', toJS(c)); } }); b.set(11); c.set(22); a.set(1); b.set(1);
No branches or pull requests
The first
the result is:
then:
or ues dereactor '@observable' in ES.Next
but the
detailInfo
is:These two are very easy to cause confusion.
In fact, itself is not
observable
,only properties will beobservable
more deatil
The text was updated successfully, but these errors were encountered: