Skip to main content

delay

delay operator introduces a specified delay between the emission of signals from the source. It delays the emission of each value by a defined duration, allowing you to control the timing of when values are processed downstream.

delay<T>(delayDuration: number, options: SignalDelayOptions<T> = {}): T

Parameters

delayDurationThe duration (in milliseconds) by which to delay the emissions
optionsOptional. The combination of CreateEffectOptions and CreateSignalOptions (excluding the allowSignalWrites property)

Example

Calculate the square of the source

Display the delayed progress after a 2000 millisecond delay.

@Component()
export class MyComponent {
progress = signal(0);
delayedProgress = signalPipe(source, delay(2000));
}