Skip to content

Home > @unseenco/backstage-dataverse > Ticker > onThisOrNextTick

Ticker.onThisOrNextTick() method

Registers for fn to be called either on this tick or the next tick.

If onThisOrNextTick() is called while Ticker.tick() is running, the side effect _will_ be called within the running tick. If you don't want this behavior, you can use onNextTick().

Note that fn will be added to a Set(). Which means, if you call onThisOrNextTick(fn) with the same fn twice in a single tick, it'll only run once.

Signature:

typescript
onThisOrNextTick(fn: ICallback): void;

Parameters

ParameterTypeDescription
fnICallbackThe function to be registered.

Returns:

void