this.setAppState
this.setAppState(update, callback)
Like this.setState
but for app state instead of component state.
update
may be an object or a function.
If update
is an object:
setAppState
will mergeupdate
intothis.appState
If update
is a function:
update
must have the form(prevAppState) => newAppState
setAppState
will callupdate
with the current appState value, and will merge the returnednewAppState
value intoappState
.
setAppState
is not synchronous, and will call callback
after it has
completed merging update
into appState
.