1 import { Observable } from '../Observable';
2 import { SchedulerAction, SchedulerLike } from '../types';
3 import { Subscriber } from '../Subscriber';
4 import { Subscription } from '../Subscription';
6 * Convert an object into an Observable of `[key, value]` pairs.
8 * <span class="informal">Turn entries of an object into a stream.</span>
10 * <img src="./img/pairs.png" width="100%">
12 * `pairs` takes an arbitrary object and returns an Observable that emits arrays. Each
13 * emitted array has exactly two elements - the first is a key from the object
14 * and the second is a value corresponding to that key. Keys are extracted from
15 * an object via `Object.keys` function, which means that they will be only
16 * enumerable keys that are present on an object directly - not ones inherited
17 * via prototype chain.
19 * By default these arrays are emitted synchronously. To change that you can
20 * pass a {@link SchedulerLike} as a second argument to `pairs`.
22 * @example <caption>Converts a javascript object to an Observable</caption>
24 * import { pairs } from 'rxjs';
34 * value => console.log(value),
36 * () => console.log('the end!')
46 * @param {Object} obj The object to inspect and turn into an
47 * Observable sequence.
48 * @param {Scheduler} [scheduler] An optional IScheduler to schedule
49 * when resulting Observable will emit values.
50 * @returns {(Observable<Array<string|T>>)} An observable sequence of
51 * [key, value] pairs from the object.
53 export declare function pairs<T>(obj: Object, scheduler?: SchedulerLike): Observable<[string, T]>;
55 export declare function dispatch<T>(this: SchedulerAction<any>, state: {
58 subscriber: Subscriber<[string, T]>;
59 subscription: Subscription;