Skip to main content

Reactor<T>

The reactor is a user-friendly interface for starting and stopping an EffectScheduler.

Calling .start() will attach the scheduler and execute the effect immediately the first time it is called.

If the reactor is stopped, calling .start() will re-attach the scheduler but will only execute the effect if any of its parents have changed since it was stopped.

You can create a reactor with reactor.

Type parameters

  • T = unknown

Index

Properties

Methods

Properties

scheduler

EffectScheduler<T>

The underlying effect scheduler.

Defined in: signia/src/EffectScheduler.ts:225

Methods

start()

Start the scheduler. The first time this is called the effect will be scheduled immediately.

If the reactor is stopped, calling this will start the scheduler again but will only execute the effect if any of its parents have changed since it was stopped.

If you need to force re-execution of the effect, pass { force: true }.

Signature

start(options?: object): void;

Parameters

NameType
options?object
options.force?boolean

Returns

void

Defined in: signia/src/EffectScheduler.ts:234

stop()

Stop the scheduler.

Signature

stop(): void;

Returns

void

Defined in: signia/src/EffectScheduler.ts:239