BACK
ReferencetimeoutWith
Reference · 113

timeoutWith

timeoutWith

Deprecated
rxjs.dev

Switches to a fallback Observable on timeout.

Signature

timeoutWith(due: number | Date, withObservable: ObservableInput): OperatorFunction

What it does

If source doesn't emit in time, it unsubscribes from it and subscribes to the fallback Observable.

When to use

Supporting legacy code. In new code, use timeout with a with/fallback config.

Deprecated API

Marked deprecated in RxJS 7. In new code, use timeout({ first, with: () => fallback$ }).

See also

timeout, catchError

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