@rxjs-ninja/rxjs-array
Version:
Operators for RxJS for filtering with boolean logic
30 lines (29 loc) • 963 B
TypeScript
/**
* @packageDocumentation
* @module Array
*/
import { OperatorFunction } from 'rxjs';
/**
* Returns an Observable that emits an Array from a source Object using Object.entries, the Array contains
* tuples of the key as a string and the value
*
* @category Object
*
* @remarks Regardless of Object key type the result Array will have a `string` key value
*
* @typeParam K The key type of the source Object
* @typeParam T The value type of the source Object
*
* @example Convert an Object into an array of entries
* ```ts
* const input = { 1: 'a', 2: 'b', 3: 'c' };
* of(input).pipe(objectEntriesToArray()).subscribe();
* ```
* Output: `[ ['1', 'a'], ['2', 'b'], ['3', 'c'] ]`
*
* @returns Observable that emits a Array from a source Object entries
*/
export declare function objectEntriesToArray<K extends string | number | symbol, T extends unknown>(): OperatorFunction<Record<K, T>, [
string,
T
][]>;