The reactor coordinates the update of registered Reactions.
- Reactions are created with
createReaction()
reaction.track(effect)
will run the effect and associate any engine read calls during the execution with the Reaction.reaction.subscribe(handler)
will invoke the handler whenever the engine read calls in the reaction might have changed after an update.
Methods#
createReaction()#
createReaction(debugName?): Reaction;
Create and return a new Reaction that is associated with this Reactor.
Parameters#
Parameter | Type |
---|---|
debugName? | string |
Returns#
Reaction
dispose()#
dispose(): void;
Dispose the reactor and all reactions. After this call, the reactor is no longer usable.
Returns#
void