1 /** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */
2 import { Observable } from '../Observable';
3 import { Subscription } from '../Subscription';
4 export function pairs(obj, scheduler) {
6 return new Observable(function (subscriber) {
7 var keys = Object.keys(obj);
8 for (var i = 0; i < keys.length && !subscriber.closed; i++) {
10 if (obj.hasOwnProperty(key)) {
11 subscriber.next([key, obj[key]]);
14 subscriber.complete();
18 return new Observable(function (subscriber) {
19 var keys = Object.keys(obj);
20 var subscription = new Subscription();
21 subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj }));
26 export function dispatch(state) {
27 var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;
28 if (!subscriber.closed) {
29 if (index < keys.length) {
30 var key = keys[index];
31 subscriber.next([key, obj[key]]);
32 subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj }));
35 subscriber.complete();
39 //# sourceMappingURL=pairs.js.map