PATH:
usr
/
local
/
lib
/
node_modules
/
ghost-cli
/
node_modules
/
rxjs
/
internal
/
operators
import { Observable } from '../Observable'; import { Subscriber } from '../Subscriber'; import { OuterSubscriber } from '../OuterSubscriber'; import { InnerSubscriber } from '../InnerSubscriber'; import { MonoTypeOperatorFunction } from '../types'; /** * Returns an Observable that emits all items emitted by the source Observable that are distinct by comparison from previous items. * * If a keySelector function is provided, then it will project each value from the source observable into a new value that it will * check for equality with previously projected values. If a keySelector function is not provided, it will use each value from the * source observable directly with an equality check against previous values. * * In JavaScript runtimes that support `Set`, this operator will use a `Set` to improve performance of the distinct value checking. * * In other runtimes, this operator will use a minimal implementation of `Set` that relies on an `Array` and `indexOf` under the * hood, so performance will degrade as more values are checked for distinction. Even in newer browsers, a long-running `distinct` * use might result in memory leaks. To help alleviate this in some scenarios, an optional `flushes` parameter is also provided so * that the internal `Set` can be "flushed", basically clearing it of values. * * ## Examples * A simple example with numbers * ```ts * import { of } from 'rxjs'; * import { distinct } from 'rxjs/operators'; * * of(1, 1, 2, 2, 2, 1, 2, 3, 4, 3, 2, 1).pipe( * distinct(), * ) * .subscribe(x => console.log(x)); // 1, 2, 3, 4 * ``` * * An example using a keySelector function * ```typescript * import { of } from 'rxjs'; * import { distinct } from 'rxjs/operators'; * * interface Person { * age: number, * name: string * } * * of<Person>( * { age: 4, name: 'Foo'}, * { age: 7, name: 'Bar'}, * { age: 5, name: 'Foo'}, * ).pipe( * distinct((p: Person) => p.name), * ) * .subscribe(x => console.log(x)); * * // displays: * // { age: 4, name: 'Foo' } * // { age: 7, name: 'Bar' } * ``` * @see {@link distinctUntilChanged} * @see {@link distinctUntilKeyChanged} * * @param {function} [keySelector] Optional function to select which value you want to check as distinct. * @param {Observable} [flushes] Optional Observable for flushing the internal HashSet of the operator. * @return {Observable} An Observable that emits items from the source Observable with distinct values. * @method distinct * @owner Observable */ export declare function distinct<T, K>(keySelector?: (value: T) => K, flushes?: Observable<any>): MonoTypeOperatorFunction<T>; /** * We need this JSDoc comment for affecting ESDoc. * @ignore * @extends {Ignored} */ export declare class DistinctSubscriber<T, K> extends OuterSubscriber<T, T> { private keySelector; private values; constructor(destination: Subscriber<T>, keySelector: (value: T) => K, flushes: Observable<any>); notifyNext(outerValue: T, innerValue: T, outerIndex: number, innerIndex: number, innerSub: InnerSubscriber<T, T>): void; notifyError(error: any, innerSub: InnerSubscriber<T, T>): void; protected _next(value: T): void; private _useKeySelector; private _finalizeNext; }
[+]
..
[-] switchMap.d.ts
[edit]
[-] race.d.ts
[edit]
[-] withLatestFrom.js
[edit]
[-] skipLast.js.map
[edit]
[-] buffer.d.ts
[edit]
[-] distinctUntilKeyChanged.d.ts
[edit]
[-] publishReplay.js
[edit]
[-] exhaust.js
[edit]
[-] zip.js.map
[edit]
[-] retry.d.ts
[edit]
[-] mergeAll.js.map
[edit]
[-] last.d.ts
[edit]
[-] single.js
[edit]
[-] mergeMapTo.js.map
[edit]
[-] distinctUntilChanged.js
[edit]
[-] windowToggle.d.ts
[edit]
[-] throttle.js
[edit]
[-] shareReplay.d.ts
[edit]
[-] auditTime.d.ts
[edit]
[-] find.js
[edit]
[-] mapTo.d.ts
[edit]
[-] bufferToggle.js
[edit]
[-] concat.js
[edit]
[-] isEmpty.js.map
[edit]
[-] concatMapTo.d.ts
[edit]
[-] first.d.ts
[edit]
[-] windowTime.js.map
[edit]
[-] windowTime.d.ts
[edit]
[-] sample.d.ts
[edit]
[-] takeWhile.js.map
[edit]
[-] sequenceEqual.d.ts
[edit]
[-] combineLatest.js
[edit]
[-] debounce.js.map
[edit]
[-] auditTime.js
[edit]
[-] multicast.js.map
[edit]
[-] observeOn.d.ts
[edit]
[-] dematerialize.js
[edit]
[-] mapTo.js.map
[edit]
[-] sample.js.map
[edit]
[-] debounceTime.d.ts
[edit]
[-] throwIfEmpty.d.ts
[edit]
[-] merge.d.ts
[edit]
[-] finalize.js
[edit]
[-] windowCount.d.ts
[edit]
[-] takeUntil.js
[edit]
[-] toArray.d.ts
[edit]
[-] concatMap.js
[edit]
[-] shareReplay.js.map
[edit]
[-] zipAll.js
[edit]
[-] windowToggle.js.map
[edit]
[-] debounceTime.js
[edit]
[-] sequenceEqual.js
[edit]
[-] exhaustMap.d.ts
[edit]
[-] toArray.js
[edit]
[-] pairwise.js.map
[edit]
[-] index.js.map
[edit]
[-] withLatestFrom.d.ts
[edit]
[-] skip.d.ts
[edit]
[-] ignoreElements.d.ts
[edit]
[-] distinctUntilChanged.d.ts
[edit]
[-] timestamp.js
[edit]
[-] shareReplay.js
[edit]
[-] mergeMap.js
[edit]
[-] retryWhen.js
[edit]
[-] bufferWhen.js.map
[edit]
[-] reduce.js
[edit]
[-] scan.js
[edit]
[-] publish.d.ts
[edit]
[-] max.js
[edit]
[-] mergeMapTo.js
[edit]
[-] bufferWhen.d.ts
[edit]
[-] throttle.js.map
[edit]
[-] skipWhile.js.map
[edit]
[-] delay.js
[edit]
[-] every.js.map
[edit]
[-] concat.js.map
[edit]
[-] map.d.ts
[edit]
[-] refCount.js
[edit]
[-] materialize.js
[edit]
[-] publishLast.js.map
[edit]
[-] windowCount.js.map
[edit]
[-] sampleTime.d.ts
[edit]
[-] toArray.js.map
[edit]
[-] index.d.ts
[edit]
[-] catchError.js
[edit]
[-] max.d.ts
[edit]
[-] takeWhile.d.ts
[edit]
[-] buffer.js
[edit]
[-] buffer.js.map
[edit]
[-] observeOn.js.map
[edit]
[-] elementAt.d.ts
[edit]
[-] elementAt.js.map
[edit]
[-] partition.d.ts
[edit]
[-] skip.js.map
[edit]
[-] exhaust.js.map
[edit]
[-] concatMap.js.map
[edit]
[-] mapTo.js
[edit]
[-] repeatWhen.js.map
[edit]
[-] pluck.js
[edit]
[-] windowWhen.d.ts
[edit]
[-] skipWhile.d.ts
[edit]
[-] bufferTime.d.ts
[edit]
[-] publish.js.map
[edit]
[-] timeInterval.d.ts
[edit]
[-] takeLast.js
[edit]
[-] distinct.js.map
[edit]
[-] retryWhen.d.ts
[edit]
[-] subscribeOn.js.map
[edit]
[-] every.d.ts
[edit]
[-] groupBy.js.map
[edit]
[-] single.d.ts
[edit]
[-] merge.js.map
[edit]
[-] distinct.d.ts
[edit]
[-] first.js.map
[edit]
[-] publishBehavior.js
[edit]
[-] zipAll.d.ts
[edit]
[-] mergeAll.d.ts
[edit]
[-] throttleTime.js
[edit]
[-] skip.js
[edit]
[-] debounce.js
[edit]
[-] count.js.map
[edit]
[-] retry.js
[edit]
[-] timeout.js
[edit]
[-] throwIfEmpty.js.map
[edit]
[-] bufferTime.js.map
[edit]
[-] concatAll.js.map
[edit]
[-] refCount.d.ts
[edit]
[-] takeUntil.js.map
[edit]
[-] take.js
[edit]
[-] pairwise.js
[edit]
[-] skipUntil.js.map
[edit]
[-] repeat.d.ts
[edit]
[-] publishLast.d.ts
[edit]
[-] max.js.map
[edit]
[-] subscribeOn.d.ts
[edit]
[-] take.js.map
[edit]
[-] audit.js
[edit]
[-] bufferWhen.js
[edit]
[-] bufferCount.js.map
[edit]
[-] reduce.js.map
[edit]
[-] concatAll.js
[edit]
[-] skipLast.js
[edit]
[-] share.d.ts
[edit]
[-] merge.js
[edit]
[-] concatMapTo.js
[edit]
[-] timeout.js.map
[edit]
[-] defaultIfEmpty.js
[edit]
[-] switchAll.d.ts
[edit]
[-] skipUntil.js
[edit]
[-] mergeAll.js
[edit]
[-] takeLast.js.map
[edit]
[-] exhaustMap.js
[edit]
[-] publishReplay.d.ts
[edit]
[-] mergeMap.d.ts
[edit]
[-] publishLast.js
[edit]
[-] ignoreElements.js
[edit]
[-] timeoutWith.d.ts
[edit]
[-] scan.d.ts
[edit]
[-] share.js.map
[edit]
[-] timeInterval.js.map
[edit]
[-] onErrorResumeNext.js
[edit]
[-] repeatWhen.d.ts
[edit]
[-] catchError.d.ts
[edit]
[-] single.js.map
[edit]
[-] delayWhen.js
[edit]
[-] switchAll.js.map
[edit]
[-] min.js
[edit]
[-] last.js.map
[edit]
[-] delay.d.ts
[edit]
[-] publishBehavior.d.ts
[edit]
[-] pairwise.d.ts
[edit]
[-] distinctUntilChanged.js.map
[edit]
[-] windowCount.js
[edit]
[-] switchMapTo.js
[edit]
[-] zip.d.ts
[edit]
[-] throwIfEmpty.js
[edit]
[-] tap.js.map
[edit]
[-] onErrorResumeNext.js.map
[edit]
[-] partition.js
[edit]
[-] subscribeOn.js
[edit]
[-] mergeMap.js.map
[edit]
[-] groupBy.js
[edit]
[-] first.js
[edit]
[-] windowWhen.js
[edit]
[-] scan.js.map
[edit]
[-] map.js.map
[edit]
[-] groupBy.d.ts
[edit]
[-] expand.d.ts
[edit]
[-] min.js.map
[edit]
[-] mergeScan.d.ts
[edit]
[-] debounceTime.js.map
[edit]
[-] tap.d.ts
[edit]
[-] defaultIfEmpty.d.ts
[edit]
[-] materialize.d.ts
[edit]
[-] retryWhen.js.map
[edit]
[-] concatAll.d.ts
[edit]
[-] windowToggle.js
[edit]
[-] windowWhen.js.map
[edit]
[-] share.js
[edit]
[-] catchError.js.map
[edit]
[-] zipAll.js.map
[edit]
[-] count.d.ts
[edit]
[-] filter.d.ts
[edit]
[-] pluck.js.map
[edit]
[-] repeatWhen.js
[edit]
[-] filter.js.map
[edit]
[-] count.js
[edit]
[-] index.js
[edit]
[-] concatMap.d.ts
[edit]
[-] switchMapTo.d.ts
[edit]
[-] find.d.ts
[edit]
[-] materialize.js.map
[edit]
[-] timeoutWith.js
[edit]
[-] zip.js
[edit]
[-] bufferCount.js
[edit]
[-] debounce.d.ts
[edit]
[-] audit.d.ts
[edit]
[-] expand.js.map
[edit]
[-] startWith.js
[edit]
[-] endWith.js.map
[edit]
[-] endWith.d.ts
[edit]
[-] endWith.js
[edit]
[-] windowTime.js
[edit]
[-] race.js
[edit]
[-] window.js.map
[edit]
[-] delayWhen.js.map
[edit]
[-] delay.js.map
[edit]
[-] switchMap.js.map
[edit]
[-] combineAll.js.map
[edit]
[-] sampleTime.js
[edit]
[-] switchMap.js
[edit]
[-] race.js.map
[edit]
[-] tap.js
[edit]
[-] switchAll.js
[edit]
[-] ignoreElements.js.map
[edit]
[-] audit.js.map
[edit]
[-] dematerialize.js.map
[edit]
[-] timestamp.js.map
[edit]
[-] exhaust.d.ts
[edit]
[-] multicast.d.ts
[edit]
[-] finalize.js.map
[edit]
[-] concat.d.ts
[edit]
[-] last.js
[edit]
[-] publishReplay.js.map
[edit]
[-] find.js.map
[edit]
[-] timeInterval.js
[edit]
[-] refCount.js.map
[edit]
[-] combineLatest.d.ts
[edit]
[-] auditTime.js.map
[edit]
[-] combineAll.js
[edit]
[-] publishBehavior.js.map
[edit]
[-] takeUntil.d.ts
[edit]
[-] delayWhen.d.ts
[edit]
[-] defaultIfEmpty.js.map
[edit]
[-] observeOn.js
[edit]
[-] skipLast.d.ts
[edit]
[-] publish.js
[edit]
[-] finalize.d.ts
[edit]
[-] mergeScan.js.map
[edit]
[-] concatMapTo.js.map
[edit]
[-] map.js
[edit]
[-] distinctUntilKeyChanged.js
[edit]
[-] throttle.d.ts
[edit]
[-] findIndex.js
[edit]
[-] filter.js
[edit]
[-] every.js
[edit]
[-] sampleTime.js.map
[edit]
[-] throttleTime.d.ts
[edit]
[-] skipUntil.d.ts
[edit]
[-] onErrorResumeNext.d.ts
[edit]
[-] sequenceEqual.js.map
[edit]
[-] takeWhile.js
[edit]
[-] mergeScan.js
[edit]
[-] bufferToggle.js.map
[edit]
[-] startWith.d.ts
[edit]
[-] exhaustMap.js.map
[edit]
[-] multicast.js
[edit]
[-] timestamp.d.ts
[edit]
[-] combineAll.d.ts
[edit]
[-] bufferToggle.d.ts
[edit]
[-] findIndex.js.map
[edit]
[-] isEmpty.js
[edit]
[-] retry.js.map
[edit]
[-] findIndex.d.ts
[edit]
[-] startWith.js.map
[edit]
[-] distinctUntilKeyChanged.js.map
[edit]
[-] isEmpty.d.ts
[edit]
[-] min.d.ts
[edit]
[-] distinct.js
[edit]
[-] bufferTime.js
[edit]
[-] mergeMapTo.d.ts
[edit]
[-] withLatestFrom.js.map
[edit]
[-] reduce.d.ts
[edit]
[-] pluck.d.ts
[edit]
[-] repeat.js
[edit]
[-] take.d.ts
[edit]
[-] combineLatest.js.map
[edit]
[-] partition.js.map
[edit]
[-] elementAt.js
[edit]
[-] skipWhile.js
[edit]
[-] timeout.d.ts
[edit]
[-] takeLast.d.ts
[edit]
[-] repeat.js.map
[edit]
[-] timeoutWith.js.map
[edit]
[-] sample.js
[edit]
[-] bufferCount.d.ts
[edit]
[-] window.js
[edit]
[-] expand.js
[edit]
[-] switchMapTo.js.map
[edit]
[-] dematerialize.d.ts
[edit]
[-] throttleTime.js.map
[edit]
[-] window.d.ts
[edit]