Skip to content

API reference > @kontsedal/olas-core > TimingSignal

TimingSignal type ​

A ReadSignal<T> returned by debounced / throttled. Extends the subscription surface with manual cancel() and flush().

  • cancel() drops any pending emission without firing. Useful when a navigation away from the screen should discard the latest in-flight draft instead of writing it through to the debounced output. - flush() immediately emits the pending value (if any). Useful at submit time: "commit whatever the user just typed without waiting for the debounce timer to fire."

Both are no-ops when nothing is pending.

Signature:

typescript
type TimingSignal<T> = ReadSignal<T> & {
  cancel(): void;
  flush(): void;
  dispose(): void;
};

References: ReadSignal

Released under the MIT License.