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

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

initial commit

  • Property mode set to 100644
File size: 1.5 KB
RevLine 
[6a3a178]1/** PURE_IMPORTS_START _Observable,_Subscription PURE_IMPORTS_END */
2import { Observable } from '../Observable';
3import { Subscription } from '../Subscription';
4export function pairs(obj, scheduler) {
5 if (!scheduler) {
6 return new Observable(function (subscriber) {
7 var keys = Object.keys(obj);
8 for (var i = 0; i < keys.length && !subscriber.closed; i++) {
9 var key = keys[i];
10 if (obj.hasOwnProperty(key)) {
11 subscriber.next([key, obj[key]]);
12 }
13 }
14 subscriber.complete();
15 });
16 }
17 else {
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 }));
22 return subscription;
23 });
24 }
25}
26export 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 }));
33 }
34 else {
35 subscriber.complete();
36 }
37 }
38}
39//# sourceMappingURL=pairs.js.map
Note: See TracBrowser for help on using the repository browser.