BACK
ReferenceswitchMapTo
Reference · 105

switchMapTo

switchMapTo

Deprecated
rxjs.dev

Switches to the same inner Observable each time.

Signature

switchMapTo(innerObservable: ObservableInput): OperatorFunction

What it does

Ignores the source value and, on each emission, switches to the given innerObservable, cancelling the previous inner.

When to use

Supporting legacy code. In new code, use switchMap(() => inner$).

Deprecated API

Marked deprecated in RxJS 7. In new code, use switchMap(() => inner$).

See also

switchMap, switchAll

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