"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var operators_1 = require("rxjs/operators");
/**
* Converts a higher-order Observable into a first-order Observable by
* subscribing to only the most recently emitted of those inner Observables.
*
* Flattens an Observable-of-Observables by dropping the
* previous inner Observable once a new one appears.
*
*
*
* `switch` subscribes to an Observable that emits Observables, also known as a
* higher-order Observable. Each time it observes one of these emitted inner
* Observables, the output Observable subscribes to the inner Observable and
* begins emitting the items emitted by that. So far, it behaves
* like {@link mergeAll}. However, when a new inner Observable is emitted,
* `switch` unsubscribes from the earlier-emitted inner Observable and
* subscribes to the new inner Observable and begins emitting items from it. It
* continues to behave like this for subsequent inner Observables.
*
* @example