-
Notifications
You must be signed in to change notification settings - Fork 39
Closed
Labels
Description
In some case, we want to change the context of a behavior for a particular need.
Example:
- in a React app, if the value of a state changes, we want to force the refresh of the UI. To do that, we could do something like:
runtime.require('db').on('update', event => {
if (event.id === this.states._id) {
this.forceUpdate();
}
}, false, true, this);
Todo:
- add an optional
context
parameter to theon
method of _Component class.
Important note:
- this behavior could not be then exported because the value of the context parameter maybe impossible to serialize into JSON. Set the core parameter to true to avoid exportation of this behavior when bundling the system.