@rxjs-ninja/rxjs-array
Version:
Operators for RxJS for filtering with boolean logic
23 lines (22 loc) • 586 B
TypeScript
/**
* @packageDocumentation
* @module Array
*/
import { OperatorFunction } from 'rxjs';
/**
* Returns an Observable that emits a Set from a source Array.
*
* @category Set
*
* @typeParam T The input type of the source Array or Set
*
* @example Convert an Array into a Set
* ```ts
* const input = [1, 1, 2, 3, 3, 4, 5];
* of(input).pipe(toSet()).subscribe();
* ```
* Output: `Set(5) {1, 2, 3, 4, 5}`
*
* @returns Observable that emits a Set from a source Array
*/
export declare function toSet<T extends unknown>(): OperatorFunction<T[], Set<T>>;