EffectScheduler

See source code

An EffectScheduler is responsible for executing side effects in response to changes in state.

You probably don't need to use this directly unless you're integrating this library with a framework of some kind.

Instead, use the react and reactor functions.

EffectScheduler: new <Result>(
  name: string,
  runEffect: (lastReactedEpoch: number) => Result,
  options?: EffectSchedulerOptions | undefined,
) => EffectScheduler<Result>;

Example

const render = new EffectScheduler("render", drawToCanvas);

render.attach();
render.execute();
Prev
MERMAID_MINDMAP_NODE_TYPE
Next
EMPTY_ARRAY