BACK
Referencedelay
Reference · 36

delay

Shifts each value in time.

Signature

delay(due: number | Date, scheduler?: SchedulerLike): MonoTypeOperatorFunction

Marble diagram

in:        --1--2--|
delay(20):    ----1--2--|

What it does

Each next is emitted due milliseconds after it arrived from the source. complete and error are shifted too.

When to use

Simulating the network in demos/tests, smooth animation (consecutive values come out with a lag), reducing visual "jitter" on rapid updates.

See also

delayWhen, timer, throttleTime

script.ts // TypeScript
CONSOLE · Console output
Hit Run to see the result...