PATH:
usr
/
local
/
lib
/
node_modules
/
ghost-cli
/
node_modules
/
rxjs
/
src
/
internal
/
operators
import { Observable } from '../Observable'; import { AsyncSubject } from '../AsyncSubject'; import { multicast } from './multicast'; import { ConnectableObservable } from '../observable/ConnectableObservable'; import { UnaryFunction } from '../types'; /** * Returns a connectable observable sequence that shares a single subscription to the * underlying sequence containing only the last notification. * *  * * Similar to {@link publish}, but it waits until the source observable completes and stores * the last emitted value. * Similarly to {@link publishReplay} and {@link publishBehavior}, this keeps storing the last * value even if it has no more subscribers. If subsequent subscriptions happen, they will * immediately get that last stored value and complete. * * ## Example * * ```ts * import { interval } from 'rxjs'; * import { publishLast, tap, take } from 'rxjs/operators'; * * const connectable = * interval(1000) * .pipe( * tap(x => console.log("side effect", x)), * take(3), * publishLast()); * * connectable.subscribe( * x => console.log( "Sub. A", x), * err => console.log("Sub. A Error", err), * () => console.log( "Sub. A Complete")); * * connectable.subscribe( * x => console.log( "Sub. B", x), * err => console.log("Sub. B Error", err), * () => console.log( "Sub. B Complete")); * * connectable.connect(); * * // Results: * // "side effect 0" * // "side effect 1" * // "side effect 2" * // "Sub. A 2" * // "Sub. B 2" * // "Sub. A Complete" * // "Sub. B Complete" * ``` * * @see {@link ConnectableObservable} * @see {@link publish} * @see {@link publishReplay} * @see {@link publishBehavior} * * @return {ConnectableObservable} An observable sequence that contains the elements of a * sequence produced by multicasting the source sequence. * @method publishLast * @owner Observable */ export function publishLast<T>(): UnaryFunction<Observable<T>, ConnectableObservable<T>> { return (source: Observable<T>) => multicast(new AsyncSubject<T>())(source); }
[-] toArray.ts
[edit]
[-] window.ts
[edit]
[-] retry.ts
[edit]
[-] mergeAll.ts
[edit]
[-] windowWhen.ts
[edit]
[-] every.ts
[edit]
[-] timeout.ts
[edit]
[-] debounceTime.ts
[edit]
[-] index.ts
[edit]
[-] takeWhile.ts
[edit]
[-] audit.ts
[edit]
[-] reduce.ts
[edit]
[-] mapTo.ts
[edit]
[-] count.ts
[edit]
[-] debounce.ts
[edit]
[-] throwIfEmpty.ts
[edit]
[-] auditTime.ts
[edit]
[-] scan.ts
[edit]
[-] switchAll.ts
[edit]
[-] map.ts
[edit]
[-] bufferCount.ts
[edit]
[-] mergeScan.ts
[edit]
[-] publish.ts
[edit]
[-] min.ts
[edit]
[+]
..
[-] publishReplay.ts
[edit]
[-] bufferTime.ts
[edit]
[-] share.ts
[edit]
[-] repeat.ts
[edit]
[-] distinct.ts
[edit]
[-] concatMapTo.ts
[edit]
[-] buffer.ts
[edit]
[-] concatMap.ts
[edit]
[-] max.ts
[edit]
[-] partition.ts
[edit]
[-] observeOn.ts
[edit]
[-] bufferWhen.ts
[edit]
[-] dematerialize.ts
[edit]
[-] throttle.ts
[edit]
[-] groupBy.ts
[edit]
[-] withLatestFrom.ts
[edit]
[-] exhaust.ts
[edit]
[-] exhaustMap.ts
[edit]
[-] retryWhen.ts
[edit]
[-] zipAll.ts
[edit]
[-] find.ts
[edit]
[-] mergeMap.ts
[edit]
[-] single.ts
[edit]
[-] last.ts
[edit]
[-] combineLatest.ts
[edit]
[-] publishLast.ts
[edit]
[-] pluck.ts
[edit]
[-] pairwise.ts
[edit]
[-] distinctUntilChanged.ts
[edit]
[-] timeInterval.ts
[edit]
[-] shareReplay.ts
[edit]
[-] skipUntil.ts
[edit]
[-] findIndex.ts
[edit]
[-] windowToggle.ts
[edit]
[-] startWith.ts
[edit]
[-] timeoutWith.ts
[edit]
[-] concat.ts
[edit]
[-] materialize.ts
[edit]
[-] timestamp.ts
[edit]
[-] onErrorResumeNext.ts
[edit]
[-] subscribeOn.ts
[edit]
[-] takeUntil.ts
[edit]
[-] skipLast.ts
[edit]
[-] throttleTime.ts
[edit]
[-] mergeMapTo.ts
[edit]
[-] multicast.ts
[edit]
[-] merge.ts
[edit]
[-] takeLast.ts
[edit]
[-] delayWhen.ts
[edit]
[-] sampleTime.ts
[edit]
[-] tap.ts
[edit]
[-] take.ts
[edit]
[-] sample.ts
[edit]
[-] filter.ts
[edit]
[-] skip.ts
[edit]
[-] expand.ts
[edit]
[-] publishBehavior.ts
[edit]
[-] sequenceEqual.ts
[edit]
[-] ignoreElements.ts
[edit]
[-] catchError.ts
[edit]
[-] endWith.ts
[edit]
[-] refCount.ts
[edit]
[-] windowCount.ts
[edit]
[-] defaultIfEmpty.ts
[edit]
[-] windowTime.ts
[edit]
[-] switchMapTo.ts
[edit]
[-] switchMap.ts
[edit]
[-] delay.ts
[edit]
[-] bufferToggle.ts
[edit]
[-] repeatWhen.ts
[edit]
[-] concatAll.ts
[edit]
[-] first.ts
[edit]
[-] zip.ts
[edit]
[-] elementAt.ts
[edit]
[-] skipWhile.ts
[edit]
[-] race.ts
[edit]
[-] finalize.ts
[edit]
[-] combineAll.ts
[edit]
[-] distinctUntilKeyChanged.ts
[edit]
[-] isEmpty.ts
[edit]