Skip to content

Change the context of the behavior #59

@ecarriou

Description

@ecarriou

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 the on 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.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions