source: trip-planner-front/node_modules/rxjs/internal/observable/pairs.js@ e29cc2e

Last change on this file since e29cc2e was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 1.6 KB
Line 
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var Observable_1 = require("../Observable");
4var Subscription_1 = require("../Subscription");
5function pairs(obj, scheduler) {
6 if (!scheduler) {
7 return new Observable_1.Observable(function (subscriber) {
8 var keys = Object.keys(obj);
9 for (var i = 0; i < keys.length && !subscriber.closed; i++) {
10 var key = keys[i];
11 if (obj.hasOwnProperty(key)) {
12 subscriber.next([key, obj[key]]);
13 }
14 }
15 subscriber.complete();
16 });
17 }
18 else {
19 return new Observable_1.Observable(function (subscriber) {
20 var keys = Object.keys(obj);
21 var subscription = new Subscription_1.Subscription();
22 subscription.add(scheduler.schedule(dispatch, 0, { keys: keys, index: 0, subscriber: subscriber, subscription: subscription, obj: obj }));
23 return subscription;
24 });
25 }
26}
27exports.pairs = pairs;
28function dispatch(state) {
29 var keys = state.keys, index = state.index, subscriber = state.subscriber, subscription = state.subscription, obj = state.obj;
30 if (!subscriber.closed) {
31 if (index < keys.length) {
32 var key = keys[index];
33 subscriber.next([key, obj[key]]);
34 subscription.add(this.schedule({ keys: keys, index: index + 1, subscriber: subscriber, subscription: subscription, obj: obj }));
35 }
36 else {
37 subscriber.complete();
38 }
39 }
40}
41exports.dispatch = dispatch;
42//# sourceMappingURL=pairs.js.map
Note: See TracBrowser for help on using the repository browser.