BACK
ReferencesubscribeOn
Reference · 103

subscribeOn

subscribeOn

rxjs.dev

Schedules when the source is subscribed via a Scheduler.

Signature

subscribeOn(scheduler: SchedulerLike, delay?: number): MonoTypeOperatorFunction

What it does

Affects when the source's subscribe logic runs. Unlike observeOn, it doesn't reschedule each notification separately.

When to use

Deferring a heavy synchronous subscription, controlling the scheduler in tests, breaking the call stack at source creation.

See also

observeOn

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