Scheduler API reference for Scheduler in Semantic UI's reactivity system clock API Reference
Categories

Scheduler

The batching engine behind reactivity. Signals queue their dependents here, and Scheduler drains them on a microtask. Most code reaches it through the free functions on Flushing rather than the class.

flush, scheduleFlush, afterFlush, and getSource are exported from @semantic-ui/reactivity as standalone functions bound to these statics. Import those instead of touching Scheduler directly.

Class Statics

Scheduler exposes its queues and flags as statics. They are read by the reactivity internals, treat them as observable state, not as a public mutation surface.

current

Scheduler.current;

The reaction currently executing, or null outside a flush. Prefer currentReaction() to read it.

Returns

A Reaction or null.

pendingReactions

Scheduler.pendingReactions;

The Set of reactions queued for the next flush.

Returns

Set<Reaction>.

afterFlushCallbacks

Scheduler.afterFlushCallbacks;

The array of callbacks queued to run after the next flush drains.

Returns

Array<() => void>.

isFlushScheduled

Scheduler.isFlushScheduled;

Whether a flush is already queued on the microtask, used to keep scheduleFlush idempotent.

Returns

boolean.

isFlushing

Scheduler.isFlushing;

Whether a flush is currently draining.

Returns

boolean.

maxFlushIterations

Scheduler.maxFlushIterations;

The pass cap before flush declares a reactive cycle and clears its queues. Defaults to 100.

Returns

number.

scheduleReaction

Scheduler.scheduleReaction(reaction);

Queues a reaction for the next flush and schedules one. Called by signals when a dependency changes, not part of the application surface.

Parameters

NameTypeDescription
reactionReactionThe reaction to queue
Previous
Debugging
Next
Dependency