flinker 2.0.0 → 2.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,3 @@
1
- var __extends = (this && this.__extends) || (function () {
2
- var extendStatics = function (d, b) {
3
- extendStatics = Object.setPrototypeOf ||
4
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
- function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
- return extendStatics(d, b);
7
- };
8
- return function (d, b) {
9
- if (typeof b !== "function" && b !== null)
10
- throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
- extendStatics(d, b);
12
- function __() { this.constructor = d; }
13
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
- };
15
- })();
16
1
  import { RXPipeline } from './RXPipeline';
17
2
  //WeakRef is not supported in RN
18
3
  // export class RXPipelineGarbage {
@@ -31,14 +16,14 @@ import { RXPipeline } from './RXPipeline';
31
16
  // Logger.i('GC: disposed pipelines:', disposedCount + '/' + this.total)
32
17
  // }
33
18
  // }
34
- var generateSUID = (function () {
35
- var value = 0;
36
- return function () {
19
+ const generateSUID = (() => {
20
+ let value = 0;
21
+ return () => {
37
22
  return value++;
38
23
  };
39
24
  })();
40
- var RXPublisher = /** @class */ (function () {
41
- function RXPublisher() {
25
+ export class RXPublisher {
26
+ constructor() {
42
27
  this.suid = generateSUID();
43
28
  this.type = 'observable';
44
29
  this._isComplete = false;
@@ -49,287 +34,230 @@ var RXPublisher = /** @class */ (function () {
49
34
  this.isSending = false;
50
35
  this.pipelines = Array();
51
36
  }
52
- Object.defineProperty(RXPublisher.prototype, "volume", {
53
- get: function () { return this.pipelines.length; },
54
- enumerable: false,
55
- configurable: true
56
- });
57
- Object.defineProperty(RXPublisher.prototype, "asObservable", {
58
- get: function () { return this; },
59
- enumerable: false,
60
- configurable: true
61
- });
62
- Object.defineProperty(RXPublisher.prototype, "isComplete", {
63
- get: function () { return this._isComplete; },
64
- enumerable: false,
65
- configurable: true
66
- });
67
- RXPublisher.prototype.pipe = function () {
68
- var pipe = new RXPipeline(this);
37
+ get volume() { return this.pipelines.length; }
38
+ get asObservable() { return this; }
39
+ get isComplete() { return this._isComplete; }
40
+ pipe() {
41
+ const pipe = new RXPipeline(this);
69
42
  this.pipelines.push(pipe);
70
43
  //RXPipelineGarbage.self.register(pipe)
71
44
  return pipe.asOperator;
72
- };
73
- RXPublisher.prototype.didSubscribe = function (p) {
45
+ }
46
+ didSubscribe(p) {
74
47
  this.isComplete && p.sendComplete(false);
75
- };
76
- RXPublisher.prototype.didUnsubscribe = function (p) {
48
+ }
49
+ didUnsubscribe(p) {
77
50
  if (this.isSending) {
78
51
  this.pendingUnsubscribePipes.push(p);
79
52
  return;
80
53
  }
81
- var index = this.pipelines.indexOf(p);
54
+ const index = this.pipelines.indexOf(p);
82
55
  index !== -1 && this.pipelines.splice(index, 1);
83
- };
84
- RXPublisher.prototype.send = function (value) {
56
+ }
57
+ send(value) {
85
58
  this.isSending = true;
86
- this.pipelines.forEach(function (i) { i.send(value, true); });
59
+ this.pipelines.forEach(i => { i.send(value, true); });
87
60
  this.isSending = false;
88
61
  this.runPendingOperations();
89
- };
90
- RXPublisher.prototype.sendError = function (e) {
62
+ }
63
+ sendError(e) {
91
64
  this.isSending = true;
92
- this.pipelines.forEach(function (i) { i.sendError(e, true); });
65
+ this.pipelines.forEach(i => { i.sendError(e, true); });
93
66
  this.isSending = false;
94
67
  this.runPendingOperations();
95
- };
96
- RXPublisher.prototype.sendComplete = function () {
68
+ }
69
+ sendComplete() {
97
70
  this.isSending = true;
98
71
  this._isComplete = true;
99
- this.pipelines.forEach(function (i) { i.sendComplete(true); });
72
+ this.pipelines.forEach(i => { i.sendComplete(true); });
100
73
  this.pipelines.length = 0;
101
74
  this.isSending = false;
102
75
  this.runPendingOperations();
103
- };
104
- RXPublisher.prototype.runPendingOperations = function () {
105
- var _this = this;
76
+ }
77
+ runPendingOperations() {
106
78
  if (this.isSending)
107
79
  return;
108
80
  if (this.pendingUnsubscribePipes.length > 0) {
109
- this.pendingUnsubscribePipes.forEach(function (p) { _this.didUnsubscribe(p); });
81
+ this.pendingUnsubscribePipes.forEach(p => { this.didUnsubscribe(p); });
110
82
  this.pendingUnsubscribePipes.length = 0;
111
83
  }
112
- };
113
- return RXPublisher;
114
- }());
115
- export { RXPublisher };
84
+ }
85
+ }
116
86
  //--------------------------------------
117
87
  // RXJustComplete
118
88
  //--------------------------------------
119
- var RXJustComplete = /** @class */ (function (_super) {
120
- __extends(RXJustComplete, _super);
121
- function RXJustComplete(value) {
122
- var _this = _super.call(this) || this;
123
- _this.value = value;
124
- value !== undefined && _this.send(value);
125
- _this.sendComplete();
126
- return _this;
127
- }
128
- RXJustComplete.prototype.didSubscribe = function (p) {
89
+ export class RXJustComplete extends RXPublisher {
90
+ constructor(value) {
91
+ super();
92
+ this.value = value;
93
+ value !== undefined && this.send(value);
94
+ this.sendComplete();
95
+ }
96
+ didSubscribe(p) {
129
97
  this.isComplete && this.value !== undefined && p.send(this.value, false);
130
98
  this.isComplete && p.sendComplete(false);
131
- };
132
- return RXJustComplete;
133
- }(RXPublisher));
134
- export { RXJustComplete };
99
+ }
100
+ }
135
101
  //--------------------------------------
136
102
  // RXJustError
137
103
  //--------------------------------------
138
- var RXJustError = /** @class */ (function (_super) {
139
- __extends(RXJustError, _super);
140
- function RXJustError(error) {
141
- var _this = _super.call(this) || this;
142
- _this.error = error;
143
- _this.sendError(error);
144
- _this.sendComplete();
145
- return _this;
146
- }
147
- RXJustError.prototype.didSubscribe = function (p) {
104
+ export class RXJustError extends RXPublisher {
105
+ constructor(error) {
106
+ super();
107
+ this.error = error;
108
+ this.sendError(error);
109
+ this.sendComplete();
110
+ }
111
+ didSubscribe(p) {
148
112
  this.isComplete && p.sendError(this.error, false);
149
113
  this.isComplete && p.sendComplete(false);
150
- };
151
- return RXJustError;
152
- }(RXPublisher));
153
- export { RXJustError };
114
+ }
115
+ }
154
116
  //--------------------------------------
155
117
  // RXDelayedComplete
156
118
  //--------------------------------------
157
- var RXDelayedComplete = /** @class */ (function (_super) {
158
- __extends(RXDelayedComplete, _super);
159
- function RXDelayedComplete(ms, value) {
160
- var _this = _super.call(this) || this;
161
- _this.value = value;
162
- setTimeout(function () {
163
- value !== undefined && _this.send(value);
164
- _this.sendComplete();
119
+ export class RXDelayedComplete extends RXPublisher {
120
+ constructor(ms, value) {
121
+ super();
122
+ this.value = value;
123
+ setTimeout(() => {
124
+ value !== undefined && this.send(value);
125
+ this.sendComplete();
165
126
  }, ms);
166
- return _this;
167
127
  }
168
- RXDelayedComplete.prototype.didSubscribe = function (p) {
128
+ didSubscribe(p) {
169
129
  this.isComplete && this.value !== undefined && p.send(this.value, false);
170
130
  this.isComplete && p.sendComplete(false);
171
- };
172
- return RXDelayedComplete;
173
- }(RXPublisher));
174
- export { RXDelayedComplete };
131
+ }
132
+ }
175
133
  //--------------------------------------
176
134
  // RXDelayedError
177
135
  //--------------------------------------
178
- var RXDelayedError = /** @class */ (function (_super) {
179
- __extends(RXDelayedError, _super);
180
- function RXDelayedError(ms, error) {
181
- var _this = _super.call(this) || this;
182
- _this.error = error;
183
- setTimeout(function () {
184
- _this.sendError(error);
185
- _this.sendComplete();
136
+ export class RXDelayedError extends RXPublisher {
137
+ constructor(ms, error) {
138
+ super();
139
+ this.error = error;
140
+ setTimeout(() => {
141
+ this.sendError(error);
142
+ this.sendComplete();
186
143
  }, ms);
187
- return _this;
188
144
  }
189
- RXDelayedError.prototype.didSubscribe = function (p) {
145
+ didSubscribe(p) {
190
146
  this.isComplete && p.sendError(this.error, false);
191
147
  this.isComplete && p.sendComplete(false);
192
- };
193
- return RXDelayedError;
194
- }(RXPublisher));
195
- export { RXDelayedError };
148
+ }
149
+ }
196
150
  //--------------------------------------
197
151
  // RXEmitter
198
152
  //--------------------------------------
199
- var RXEmitter = /** @class */ (function (_super) {
200
- __extends(RXEmitter, _super);
201
- function RXEmitter() {
202
- var _this = _super.call(this) || this;
203
- _this._hasValue = false;
204
- _this.hasError = false;
205
- _this._err = undefined;
206
- return _this;
207
- }
208
- Object.defineProperty(RXEmitter.prototype, "value", {
209
- get: function () { return this._value; },
210
- enumerable: false,
211
- configurable: true
212
- });
213
- Object.defineProperty(RXEmitter.prototype, "err", {
214
- get: function () { return this._err; },
215
- enumerable: false,
216
- configurable: true
217
- });
218
- RXEmitter.prototype.send = function (value) {
153
+ export class RXEmitter extends RXPublisher {
154
+ get value() { return this._value; }
155
+ get err() { return this._err; }
156
+ constructor() {
157
+ super();
158
+ this._hasValue = false;
159
+ this.hasError = false;
160
+ this._err = undefined;
161
+ }
162
+ send(value) {
219
163
  if (this.isComplete)
220
164
  return;
221
165
  this._value = value;
222
166
  this._hasValue = true;
223
- _super.prototype.send.call(this, value);
224
- };
225
- RXEmitter.prototype.sendError = function (e) {
167
+ super.send(value);
168
+ }
169
+ sendError(e) {
226
170
  if (this.isComplete)
227
171
  return;
228
172
  this._err = e;
229
173
  this.hasError = true;
230
- _super.prototype.sendError.call(this, e);
231
- };
232
- RXEmitter.prototype.sendComplete = function () {
174
+ super.sendError(e);
175
+ }
176
+ sendComplete() {
233
177
  if (this.isComplete)
234
178
  return;
235
- _super.prototype.sendComplete.call(this);
236
- };
237
- RXEmitter.prototype.didSubscribe = function (p) {
179
+ super.sendComplete();
180
+ }
181
+ didSubscribe(p) {
238
182
  this.hasError && p.sendError(this.err, false);
239
183
  !this.hasError && this._hasValue && p.send(this.value, false);
240
184
  this.isComplete && p.sendComplete(false);
241
- };
242
- return RXEmitter;
243
- }(RXPublisher));
244
- export { RXEmitter };
185
+ }
186
+ }
245
187
  //--------------------------------------
246
188
  // RXSubject
247
189
  //--------------------------------------
248
- var RXSubject = /** @class */ (function (_super) {
249
- __extends(RXSubject, _super);
250
- function RXSubject(value) {
251
- var _this = _super.call(this) || this;
252
- _this._hasError = false;
253
- _this._err = undefined;
254
- _this._value = value;
255
- return _this;
256
- }
257
- Object.defineProperty(RXSubject.prototype, "value", {
258
- get: function () { return this._value; },
259
- enumerable: false,
260
- configurable: true
261
- });
262
- Object.defineProperty(RXSubject.prototype, "err", {
263
- get: function () {
264
- return this._err;
265
- },
266
- enumerable: false,
267
- configurable: true
268
- });
269
- RXSubject.prototype.send = function (value) {
190
+ export class RXSubject extends RXPublisher {
191
+ get value() { return this._value; }
192
+ get err() {
193
+ return this._err;
194
+ }
195
+ constructor(value) {
196
+ super();
197
+ this._hasError = false;
198
+ this._err = undefined;
199
+ this._value = value;
200
+ }
201
+ send(value) {
270
202
  if (this.isComplete)
271
203
  return;
272
204
  this._value = value;
273
- _super.prototype.send.call(this, value);
274
- };
275
- RXSubject.prototype.resend = function () {
276
- _super.prototype.send.call(this, this.value);
277
- };
278
- RXSubject.prototype.sendError = function (e) {
205
+ super.send(value);
206
+ }
207
+ resend() {
208
+ super.send(this.value);
209
+ }
210
+ sendError(e) {
279
211
  if (this.isComplete)
280
212
  return;
281
213
  this._err = e;
282
214
  this._hasError = true;
283
- _super.prototype.sendError.call(this, e);
284
- };
285
- RXSubject.prototype.sendComplete = function () {
215
+ super.sendError(e);
216
+ }
217
+ sendComplete() {
286
218
  if (this.isComplete)
287
219
  return;
288
220
  this._isComplete = true;
289
- _super.prototype.sendComplete.call(this);
290
- };
291
- RXSubject.prototype.didSubscribe = function (p) {
221
+ super.sendComplete();
222
+ }
223
+ didSubscribe(p) {
292
224
  this._hasError && p.sendError(this.err, false);
293
225
  !this._hasError && p.send(this.value, false);
294
226
  this.isComplete && p.sendComplete(false);
295
- };
296
- return RXSubject;
297
- }(RXPublisher));
298
- export { RXSubject };
227
+ }
228
+ }
299
229
  //--------------------------------------
300
230
  // RXBuffer
301
231
  //--------------------------------------
302
- var RXBuffer = /** @class */ (function (_super) {
303
- __extends(RXBuffer, _super);
304
- function RXBuffer() {
305
- var _this = _super !== null && _super.apply(this, arguments) || this;
306
- _this.values = Array();
307
- _this.errors = Array();
308
- _this.isError = Array();
309
- return _this;
310
- }
311
- RXBuffer.prototype.send = function (value) {
232
+ export class RXBuffer extends RXPublisher {
233
+ constructor() {
234
+ super(...arguments);
235
+ this.values = Array();
236
+ this.errors = Array();
237
+ this.isError = Array();
238
+ }
239
+ send(value) {
312
240
  if (this.isComplete)
313
241
  return;
314
242
  this.values.push(value);
315
243
  this.isError.push(false);
316
- _super.prototype.send.call(this, value);
317
- };
318
- RXBuffer.prototype.sendError = function (e) {
244
+ super.send(value);
245
+ }
246
+ sendError(e) {
319
247
  if (this.isComplete)
320
248
  return;
321
249
  this.errors.push(e);
322
250
  this.isError.push(true);
323
- _super.prototype.sendError.call(this, e);
324
- };
325
- RXBuffer.prototype.sendComplete = function () {
251
+ super.sendError(e);
252
+ }
253
+ sendComplete() {
326
254
  if (this.isComplete)
327
255
  return;
328
256
  this._isComplete = true;
329
- _super.prototype.sendComplete.call(this);
330
- };
331
- RXBuffer.prototype.didSubscribe = function (p) {
332
- for (var i = 0, v = 0, e = 0; i < this.isError.length; i++) {
257
+ super.sendComplete();
258
+ }
259
+ didSubscribe(p) {
260
+ for (let i = 0, v = 0, e = 0; i < this.isError.length; i++) {
333
261
  if (this.isError[i]) {
334
262
  e < this.errors.length && p.sendError(this.errors[e], false);
335
263
  e++;
@@ -340,48 +268,36 @@ var RXBuffer = /** @class */ (function (_super) {
340
268
  }
341
269
  }
342
270
  this.isComplete && p.sendComplete(false);
343
- };
344
- return RXBuffer;
345
- }(RXPublisher));
346
- export { RXBuffer };
271
+ }
272
+ }
347
273
  //--------------------------------------
348
274
  // RXOperation
349
275
  //--------------------------------------
350
- var RXOperation = /** @class */ (function (_super) {
351
- __extends(RXOperation, _super);
352
- function RXOperation() {
353
- var _this = _super !== null && _super.apply(this, arguments) || this;
354
- _this._value = undefined;
355
- _this._hasError = false;
356
- _this._err = undefined;
357
- return _this;
358
- }
359
- Object.defineProperty(RXOperation.prototype, "value", {
360
- get: function () { return this._value; },
361
- enumerable: false,
362
- configurable: true
363
- });
364
- Object.defineProperty(RXOperation.prototype, "err", {
365
- get: function () { return this._err; },
366
- enumerable: false,
367
- configurable: true
368
- });
369
- RXOperation.prototype.success = function (value) {
276
+ export class RXOperation extends RXPublisher {
277
+ constructor() {
278
+ super(...arguments);
279
+ this._value = undefined;
280
+ this._hasError = false;
281
+ this._err = undefined;
282
+ }
283
+ get value() { return this._value; }
284
+ get err() { return this._err; }
285
+ success(value) {
370
286
  if (this.isComplete)
371
287
  return;
372
288
  this._value = value;
373
- _super.prototype.send.call(this, value);
374
- _super.prototype.sendComplete.call(this);
375
- };
376
- RXOperation.prototype.fail = function (e) {
289
+ super.send(value);
290
+ super.sendComplete();
291
+ }
292
+ fail(e) {
377
293
  if (this.isComplete)
378
294
  return;
379
295
  this._err = e;
380
296
  this._hasError = true;
381
- _super.prototype.sendError.call(this, e);
382
- _super.prototype.sendComplete.call(this);
383
- };
384
- RXOperation.prototype.didSubscribe = function (p) {
297
+ super.sendError(e);
298
+ super.sendComplete();
299
+ }
300
+ didSubscribe(p) {
385
301
  if (!this.isComplete)
386
302
  return;
387
303
  if (this._hasError) {
@@ -392,173 +308,139 @@ var RXOperation = /** @class */ (function (_super) {
392
308
  p.send(this.value, false);
393
309
  p.sendComplete(false);
394
310
  }
395
- };
396
- return RXOperation;
397
- }(RXPublisher));
398
- export { RXOperation };
311
+ }
312
+ }
399
313
  //--------------------------------------
400
314
  // RXCombine
401
315
  //--------------------------------------
402
- var RXCombine = /** @class */ (function (_super) {
403
- __extends(RXCombine, _super);
404
- function RXCombine(list) {
405
- var _this = _super.call(this) || this;
406
- _this._values = [];
407
- _this._hasError = false;
408
- _this._err = undefined;
409
- var count = list.length;
410
- _this._values = new Array(list.length).fill(undefined);
411
- list.forEach(function (rx, ind) {
412
- var op = rx instanceof RXPublisher ? rx.asObservable.pipe() : rx;
413
- op.onReceive(function (v) {
414
- _this.values[ind] = v;
415
- _super.prototype.send.call(_this, _this.values);
316
+ export class RXCombine extends RXPublisher {
317
+ get values() { return this._values; }
318
+ get err() { return this._err; }
319
+ constructor(list) {
320
+ super();
321
+ this._values = [];
322
+ this._hasError = false;
323
+ this._err = undefined;
324
+ let count = list.length;
325
+ this._values = new Array(list.length).fill(undefined);
326
+ list.forEach((rx, ind) => {
327
+ const op = rx instanceof RXPublisher ? rx.asObservable.pipe() : rx;
328
+ op.onReceive(v => {
329
+ this.values[ind] = v;
330
+ super.send(this.values);
416
331
  })
417
- .onError(function (e) {
418
- _this._err = e;
419
- _this._hasError = true;
420
- _super.prototype.sendError.call(_this, e);
332
+ .onError((e) => {
333
+ this._err = e;
334
+ this._hasError = true;
335
+ super.sendError(e);
421
336
  })
422
- .onComplete(function () {
337
+ .onComplete(() => {
423
338
  count--;
424
339
  if (count === 0) {
425
- _this._isComplete = true;
426
- _super.prototype.sendComplete.call(_this);
340
+ this._isComplete = true;
341
+ super.sendComplete();
427
342
  }
428
343
  })
429
344
  .subscribe();
430
345
  });
431
346
  if (count === 0) {
432
- _super.prototype.sendComplete.call(_this);
347
+ super.sendComplete();
433
348
  }
434
- return _this;
435
- }
436
- Object.defineProperty(RXCombine.prototype, "values", {
437
- get: function () { return this._values; },
438
- enumerable: false,
439
- configurable: true
440
- });
441
- Object.defineProperty(RXCombine.prototype, "err", {
442
- get: function () { return this._err; },
443
- enumerable: false,
444
- configurable: true
445
- });
446
- RXCombine.prototype.didSubscribe = function (p) {
349
+ }
350
+ didSubscribe(p) {
447
351
  !this._hasError && p.send(this.values, false);
448
352
  this._hasError && p.sendError(this.err, false);
449
353
  this.isComplete && p.sendComplete(false);
450
- };
451
- return RXCombine;
452
- }(RXPublisher));
453
- export { RXCombine };
354
+ }
355
+ }
454
356
  //--------------------------------------
455
357
  // RXFrom
456
358
  //--------------------------------------
457
- var RXFrom = /** @class */ (function (_super) {
458
- __extends(RXFrom, _super);
459
- function RXFrom(list) {
460
- var _this = _super.call(this) || this;
461
- _this.values = list;
462
- _this.sendComplete();
463
- return _this;
464
- }
465
- RXFrom.prototype.didSubscribe = function (p) {
466
- this.values.forEach(function (v) { p.send(v, false); });
359
+ export class RXFrom extends RXPublisher {
360
+ constructor(list) {
361
+ super();
362
+ this.values = list;
363
+ this.sendComplete();
364
+ }
365
+ didSubscribe(p) {
366
+ this.values.forEach(v => { p.send(v, false); });
467
367
  p.sendComplete(false);
468
- };
469
- return RXFrom;
470
- }(RXPublisher));
471
- export { RXFrom };
368
+ }
369
+ }
472
370
  //--------------------------------------
473
371
  // RXWaitUntilComplete
474
372
  //--------------------------------------
475
373
  /*
476
374
  * wait until all publishers are complete and then send a value of the last publisher if it's specified
477
375
  * */
478
- var RXWaitUntilComplete = /** @class */ (function (_super) {
479
- __extends(RXWaitUntilComplete, _super);
480
- function RXWaitUntilComplete(list, resultPublisher) {
481
- var _this = _super.call(this) || this;
482
- _this._value = undefined;
483
- _this._hasError = false;
484
- _this._err = undefined;
485
- _this._resultPublisher = resultPublisher;
486
- var count = Array.isArray(list) ? list.length : 1;
376
+ export class RXWaitUntilComplete extends RXPublisher {
377
+ get value() { return this._value; }
378
+ get err() { return this._err; }
379
+ constructor(list, resultPublisher) {
380
+ super();
381
+ this._value = undefined;
382
+ this._hasError = false;
383
+ this._err = undefined;
384
+ this._resultPublisher = resultPublisher;
385
+ let count = Array.isArray(list) ? list.length : 1;
487
386
  if (Array.isArray(list)) {
488
- list.forEach(function (ob) {
489
- return ob.pipe()
490
- .onError(function (e) {
491
- _this._err = e;
492
- _this._hasError = true;
493
- _super.prototype.sendError.call(_this, e);
494
- })
495
- .onComplete(function () {
496
- count--;
497
- if (count === 0)
498
- _this.subscribeToResultPublisher();
499
- })
500
- .subscribe();
501
- });
387
+ list.forEach(ob => ob.pipe()
388
+ .onError(e => {
389
+ this._err = e;
390
+ this._hasError = true;
391
+ super.sendError(e);
392
+ })
393
+ .onComplete(() => {
394
+ count--;
395
+ if (count === 0)
396
+ this.subscribeToResultPublisher();
397
+ })
398
+ .subscribe());
502
399
  if (count === 0)
503
- _this.subscribeToResultPublisher();
400
+ this.subscribeToResultPublisher();
504
401
  }
505
402
  else {
506
403
  list.pipe()
507
- .onError(function (e) {
508
- _this._err = e;
509
- _this._hasError = true;
510
- _super.prototype.sendError.call(_this, e);
404
+ .onError(e => {
405
+ this._err = e;
406
+ this._hasError = true;
407
+ super.sendError(e);
511
408
  })
512
- .onComplete(function () {
513
- _this.subscribeToResultPublisher();
409
+ .onComplete(() => {
410
+ this.subscribeToResultPublisher();
514
411
  })
515
412
  .subscribe();
516
413
  }
517
- return _this;
518
- }
519
- Object.defineProperty(RXWaitUntilComplete.prototype, "value", {
520
- get: function () { return this._value; },
521
- enumerable: false,
522
- configurable: true
523
- });
524
- Object.defineProperty(RXWaitUntilComplete.prototype, "err", {
525
- get: function () { return this._err; },
526
- enumerable: false,
527
- configurable: true
528
- });
529
- RXWaitUntilComplete.prototype.subscribeToResultPublisher = function () {
530
- var _this = this;
414
+ }
415
+ subscribeToResultPublisher() {
531
416
  if (this._resultPublisher) {
532
417
  this._resultPublisher.pipe()
533
- .onReceive(function (v) {
534
- _this._value = v;
535
- _super.prototype.send.call(_this, v);
418
+ .onReceive(v => {
419
+ this._value = v;
420
+ super.send(v);
536
421
  })
537
- .onError(function (e) {
538
- _this._err = e;
539
- _this._hasError = true;
540
- _super.prototype.sendError.call(_this, e);
422
+ .onError((e) => {
423
+ this._err = e;
424
+ this._hasError = true;
425
+ super.sendError(e);
541
426
  })
542
- .onComplete(function () {
543
- _this._isComplete = true;
544
- _super.prototype.sendComplete.call(_this);
427
+ .onComplete(() => {
428
+ this._isComplete = true;
429
+ super.sendComplete();
545
430
  })
546
431
  .subscribe();
547
432
  }
548
433
  else {
549
434
  this._isComplete = true;
550
- _super.prototype.sendComplete.call(this);
435
+ super.sendComplete();
551
436
  }
552
- };
553
- RXWaitUntilComplete.prototype.didSubscribe = function (p) {
554
- var _a;
555
- !this._hasError && this.isComplete && ((_a = this._resultPublisher) === null || _a === void 0 ? void 0 : _a.isComplete) && p.send(this.value, false);
437
+ }
438
+ didSubscribe(p) {
439
+ !this._hasError && this.isComplete && this._resultPublisher?.isComplete && p.send(this.value, false);
556
440
  this._hasError && p.sendError(this.err, false);
557
441
  this.isComplete && p.sendComplete(false);
558
- };
559
- return RXWaitUntilComplete;
560
- }(RXPublisher));
561
- export { RXWaitUntilComplete };
442
+ }
443
+ }
562
444
  /*
563
445
  *
564
446
  * UI
@@ -567,57 +449,43 @@ export { RXWaitUntilComplete };
567
449
  //--------------------------------------
568
450
  // RXObservableEntity
569
451
  //--------------------------------------
570
- var RXObservableEntity = /** @class */ (function (_super) {
571
- __extends(RXObservableEntity, _super);
572
- function RXObservableEntity() {
573
- return _super !== null && _super.apply(this, arguments) || this;
574
- }
575
- RXObservableEntity.prototype.mutated = function () {
452
+ export class RXObservableEntity extends RXPublisher {
453
+ mutated() {
576
454
  this.send(this);
577
- };
578
- RXObservableEntity.prototype.send = function (value) {
579
- _super.prototype.send.call(this, value);
580
- };
581
- RXObservableEntity.prototype.dispose = function () {
455
+ }
456
+ send(value) {
457
+ super.send(value);
458
+ }
459
+ dispose() {
582
460
  this.sendComplete();
583
- };
584
- RXObservableEntity.prototype.didSubscribe = function (p) {
461
+ }
462
+ didSubscribe(p) {
585
463
  p.send(this, false);
586
464
  this.isComplete && p.sendComplete(false);
587
- };
588
- return RXObservableEntity;
589
- }(RXPublisher));
590
- export { RXObservableEntity };
465
+ }
466
+ }
591
467
  //--------------------------------------
592
468
  // RXMutableValue
593
469
  //--------------------------------------
594
- var RXObservableValue = /** @class */ (function (_super) {
595
- __extends(RXObservableValue, _super);
596
- function RXObservableValue(value) {
597
- var _this = _super.call(this) || this;
598
- _this._value = value;
599
- return _this;
600
- }
601
- Object.defineProperty(RXObservableValue.prototype, "value", {
602
- get: function () { return this._value; },
603
- set: function (value) {
604
- if (value !== this._value) {
605
- this._value = value;
606
- _super.prototype.send.call(this, value);
607
- }
608
- },
609
- enumerable: false,
610
- configurable: true
611
- });
612
- RXObservableValue.prototype.didSubscribe = function (p) {
470
+ export class RXObservableValue extends RXPublisher {
471
+ get value() { return this._value; }
472
+ set value(value) {
473
+ if (value !== this._value) {
474
+ this._value = value;
475
+ super.send(value);
476
+ }
477
+ }
478
+ constructor(value) {
479
+ super();
480
+ this._value = value;
481
+ }
482
+ didSubscribe(p) {
613
483
  p.send(this.value, false);
614
484
  this.isComplete && p.sendComplete(false);
615
- };
616
- return RXObservableValue;
617
- }(RXPublisher));
618
- export { RXObservableValue };
619
- var RXQueueOperator = /** @class */ (function () {
620
- function RXQueueOperator(op) {
485
+ }
486
+ }
487
+ export class RXQueueOperator {
488
+ constructor(op) {
621
489
  this.inProgress = true;
622
490
  this.value = undefined;
623
491
  this.op = op;
@@ -625,98 +493,78 @@ var RXQueueOperator = /** @class */ (function () {
625
493
  //--------------------------------------
626
494
  // RXSender Protocol
627
495
  //--------------------------------------
628
- RXQueueOperator.prototype.send = function (value) {
629
- var _a;
496
+ send(value) {
630
497
  if (!this.op.isComplete) {
631
- (_a = this.child) === null || _a === void 0 ? void 0 : _a.send(value);
498
+ this.child?.send(value);
632
499
  }
633
- };
500
+ }
634
501
  //--------------------------------------
635
502
  // OPERATORS
636
503
  //--------------------------------------
637
- RXQueueOperator.prototype.next = function (f) {
638
- var operator = this.addChild(new RXQueueNext(this.op, f));
504
+ next(f) {
505
+ const operator = this.addChild(new RXQueueNext(this.op, f));
639
506
  if (!this.inProgress) {
640
507
  operator.send(this.value);
641
508
  }
642
509
  return operator;
643
- };
644
- RXQueueOperator.prototype.addChild = function (op) {
510
+ }
511
+ addChild(op) {
645
512
  this.child = op;
646
513
  return op;
647
- };
648
- RXQueueOperator.prototype.complete = function () {
649
- var _this = this;
514
+ }
515
+ complete() {
650
516
  if (!this.op.isComplete) {
651
- this.next(function (res) {
652
- _this.op.success(res);
653
- return _this.op;
517
+ this.next(res => {
518
+ this.op.success(res);
519
+ return this.op;
654
520
  });
655
521
  }
656
522
  return this.op.asObservable;
657
- };
658
- return RXQueueOperator;
659
- }());
660
- export { RXQueueOperator };
661
- var RXQueueNext = /** @class */ (function (_super) {
662
- __extends(RXQueueNext, _super);
663
- function RXQueueNext(op, mapper) {
664
- var _this = _super.call(this, op) || this;
665
- _this.mapper = mapper;
666
- return _this;
667
- }
668
- RXQueueNext.prototype.send = function (value) {
669
- var _this = this;
523
+ }
524
+ }
525
+ class RXQueueNext extends RXQueueOperator {
526
+ constructor(op, mapper) {
527
+ super(op);
528
+ this.mapper = mapper;
529
+ }
530
+ send(value) {
670
531
  if (this.op.isComplete)
671
532
  return;
672
- var rx = this.mapper(value);
533
+ const rx = this.mapper(value);
673
534
  rx.pipe()
674
- .onReceive(function (v) {
675
- _this.value = v;
535
+ .onReceive((v) => {
536
+ this.value = v;
676
537
  })
677
- .onError(function (e) {
678
- _this.op.fail(e);
538
+ .onError((e) => {
539
+ this.op.fail(e);
679
540
  })
680
- .onComplete(function () {
681
- _this.inProgress = false;
682
- _super.prototype.send.call(_this, _this.value);
541
+ .onComplete(() => {
542
+ this.inProgress = false;
543
+ super.send(this.value);
683
544
  })
684
545
  .subscribe();
685
- };
686
- return RXQueueNext;
687
- }(RXQueueOperator));
688
- var RXQueue = /** @class */ (function (_super) {
689
- __extends(RXQueue, _super);
690
- function RXQueue() {
691
- var _this = _super.call(this, new RXOperation()) || this;
692
- _this.inProgress = false;
693
- return _this;
694
- }
695
- Object.defineProperty(RXQueue.prototype, "asObservable", {
696
- //--------------------------------------
697
- // asObservable
698
- //--------------------------------------
699
- get: function () { return this.op.asObservable; },
700
- enumerable: false,
701
- configurable: true
702
- });
703
- Object.defineProperty(RXQueue.prototype, "isComplete", {
704
- //--------------------------------------
705
- // isComplete
706
- //--------------------------------------
707
- get: function () { return this.op.isComplete; },
708
- enumerable: false,
709
- configurable: true
710
- });
711
- RXQueue.prototype.next = function (f) {
712
- return _super.prototype.next.call(this, f);
713
- };
714
- RXQueue.prototype.success = function (v) {
546
+ }
547
+ }
548
+ export class RXQueue extends RXQueueOperator {
549
+ constructor() {
550
+ super(new RXOperation());
551
+ this.inProgress = false;
552
+ }
553
+ //--------------------------------------
554
+ // asObservable
555
+ //--------------------------------------
556
+ get asObservable() { return this.op.asObservable; }
557
+ //--------------------------------------
558
+ // isComplete
559
+ //--------------------------------------
560
+ get isComplete() { return this.op.isComplete; }
561
+ next(f) {
562
+ return super.next(f);
563
+ }
564
+ success(v) {
715
565
  this.op.success(v);
716
- };
717
- RXQueue.prototype.fail = function (e) {
566
+ }
567
+ fail(e) {
718
568
  this.op.fail(e);
719
- };
720
- return RXQueue;
721
- }(RXQueueOperator));
722
- export { RXQueue };
569
+ }
570
+ }