silentium 0.0.116 → 0.0.118
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.
- package/CHANGELOG.md +14 -0
- package/dist/silentium.cjs +142 -144
- package/dist/silentium.cjs.map +1 -1
- package/dist/silentium.d.ts +94 -72
- package/dist/silentium.js +138 -140
- package/dist/silentium.js.map +1 -1
- package/dist/silentium.min.js +1 -1
- package/dist/silentium.min.mjs +1 -1
- package/dist/silentium.min.mjs.map +1 -1
- package/dist/silentium.mjs +138 -140
- package/dist/silentium.mjs.map +1 -1
- package/package.json +1 -1
- package/src/base/ComponentClass.ts +4 -0
- package/src/base/DestroyContainer.ts +2 -2
- package/src/base/Event.ts +2 -2
- package/src/base/Local.ts +7 -7
- package/src/base/Of.ts +2 -2
- package/src/base/Transport.ts +17 -10
- package/src/base/Void.ts +2 -2
- package/src/components/All.ts +21 -17
- package/src/components/Any.ts +4 -4
- package/src/components/Applied.ts +10 -7
- package/src/components/Catch.ts +4 -4
- package/src/components/Chain.ts +27 -29
- package/src/components/ExecutorApplied.ts +2 -2
- package/src/components/Filtered.ts +14 -10
- package/src/components/FromEvent.ts +17 -16
- package/src/components/FromPromise.ts +9 -7
- package/src/components/Late.ts +2 -2
- package/src/components/LateShared.ts +2 -2
- package/src/components/Map.ts +10 -11
- package/src/components/Once.ts +8 -8
- package/src/components/Primitive.ts +2 -2
- package/src/components/Sequence.ts +11 -11
- package/src/components/Shared.ts +2 -2
- package/src/components/SharedSource.ts +6 -2
- package/src/components/Stream.ts +5 -5
- package/src/components/TransportApplied.ts +5 -2
- package/src/components/TransportArgs.ts +6 -2
- package/src/components/TransportDestroyable.ts +10 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [0.0.118](https://github.com/silentium-lab/silentium/compare/v0.0.117...v0.0.118) (2025-11-01)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* **main:** small refactorings ([1b1e720](https://github.com/silentium-lab/silentium/commit/1b1e720a79500b27eaa7e3ccbc1e7f5f379a5aab))
|
|
11
|
+
|
|
12
|
+
### [0.0.117](https://github.com/silentium-lab/silentium/compare/v0.0.116...v0.0.117) (2025-11-01)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **main:** transport parent component ([686edae](https://github.com/silentium-lab/silentium/commit/686edae2bda0150411f3d9aeb346ca0c0b0d3d7e))
|
|
18
|
+
|
|
5
19
|
### [0.0.116](https://github.com/silentium-lab/silentium/compare/v0.0.115...v0.0.116) (2025-10-31)
|
|
6
20
|
|
|
7
21
|
|
package/dist/silentium.cjs
CHANGED
|
@@ -55,9 +55,9 @@ var __defProp$j = Object.defineProperty;
|
|
|
55
55
|
var __defNormalProp$j = (obj, key, value) => key in obj ? __defProp$j(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
56
56
|
var __publicField$j = (obj, key, value) => __defNormalProp$j(obj, key + "" , value);
|
|
57
57
|
function DestroyContainer() {
|
|
58
|
-
return new
|
|
58
|
+
return new DestroyContainerImpl();
|
|
59
59
|
}
|
|
60
|
-
class
|
|
60
|
+
class DestroyContainerImpl {
|
|
61
61
|
constructor() {
|
|
62
62
|
__publicField$j(this, "destructors", []);
|
|
63
63
|
}
|
|
@@ -75,9 +75,9 @@ var __defProp$i = Object.defineProperty;
|
|
|
75
75
|
var __defNormalProp$i = (obj, key, value) => key in obj ? __defProp$i(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
76
76
|
var __publicField$i = (obj, key, value) => __defNormalProp$i(obj, key + "" , value);
|
|
77
77
|
function Event(eventExecutor) {
|
|
78
|
-
return new
|
|
78
|
+
return new EventImpl(eventExecutor);
|
|
79
79
|
}
|
|
80
|
-
class
|
|
80
|
+
class EventImpl {
|
|
81
81
|
constructor(eventExecutor) {
|
|
82
82
|
this.eventExecutor = eventExecutor;
|
|
83
83
|
__publicField$i(this, "mbDestructor");
|
|
@@ -99,17 +99,17 @@ var __defProp$h = Object.defineProperty;
|
|
|
99
99
|
var __defNormalProp$h = (obj, key, value) => key in obj ? __defProp$h(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
100
100
|
var __publicField$h = (obj, key, value) => __defNormalProp$h(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
101
101
|
function Local($base) {
|
|
102
|
-
return new
|
|
102
|
+
return new LocalEvent($base);
|
|
103
103
|
}
|
|
104
|
-
class
|
|
104
|
+
class LocalEvent {
|
|
105
105
|
constructor($base) {
|
|
106
106
|
this.$base = $base;
|
|
107
107
|
__publicField$h(this, "destroyed", false);
|
|
108
|
-
__publicField$h(this, "transport",
|
|
109
|
-
if (!
|
|
110
|
-
|
|
108
|
+
__publicField$h(this, "transport", TransportParent(function(v, child) {
|
|
109
|
+
if (!child.destroyed) {
|
|
110
|
+
this.use(v);
|
|
111
111
|
}
|
|
112
|
-
}));
|
|
112
|
+
}, this));
|
|
113
113
|
ensureEvent($base, "Local: $base");
|
|
114
114
|
}
|
|
115
115
|
event(transport) {
|
|
@@ -122,9 +122,9 @@ class TheLocal {
|
|
|
122
122
|
}
|
|
123
123
|
|
|
124
124
|
function Of(value) {
|
|
125
|
-
return new
|
|
125
|
+
return new OfEvent(value);
|
|
126
126
|
}
|
|
127
|
-
class
|
|
127
|
+
class OfEvent {
|
|
128
128
|
constructor(value) {
|
|
129
129
|
this.value = value;
|
|
130
130
|
}
|
|
@@ -135,9 +135,9 @@ class TheOf {
|
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
function Void() {
|
|
138
|
-
return new
|
|
138
|
+
return new VoidImpl();
|
|
139
139
|
}
|
|
140
|
-
class
|
|
140
|
+
class VoidImpl {
|
|
141
141
|
use() {
|
|
142
142
|
return this;
|
|
143
143
|
}
|
|
@@ -183,9 +183,9 @@ class OwnerPool {
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
function Transport(transportExecutor) {
|
|
186
|
-
return new
|
|
186
|
+
return new TransportImpl(transportExecutor);
|
|
187
187
|
}
|
|
188
|
-
class
|
|
188
|
+
class TransportImpl {
|
|
189
189
|
constructor(transportExecutor) {
|
|
190
190
|
this.transportExecutor = transportExecutor;
|
|
191
191
|
ensureFunction(transportExecutor, "Transport: transport executor");
|
|
@@ -196,33 +196,36 @@ class TheTransport {
|
|
|
196
196
|
}
|
|
197
197
|
}
|
|
198
198
|
function TransportEvent(transportExecutor) {
|
|
199
|
-
return new
|
|
199
|
+
return new TransportEventImpl(transportExecutor);
|
|
200
200
|
}
|
|
201
|
-
class
|
|
201
|
+
class TransportEventImpl {
|
|
202
202
|
constructor(executor) {
|
|
203
203
|
this.executor = executor;
|
|
204
|
-
ensureFunction(executor, "
|
|
204
|
+
ensureFunction(executor, "TransportEvent: transport executor");
|
|
205
205
|
}
|
|
206
206
|
use(value) {
|
|
207
207
|
return this.executor(value);
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
|
-
|
|
210
|
+
function TransportParent(executor, ...args) {
|
|
211
|
+
return new TransportParentImpl(executor, args);
|
|
212
|
+
}
|
|
213
|
+
class TransportParentImpl {
|
|
211
214
|
constructor(executor, args = [], _child) {
|
|
212
215
|
this.executor = executor;
|
|
213
216
|
this.args = args;
|
|
214
217
|
this._child = _child;
|
|
215
|
-
ensureFunction(executor, "
|
|
218
|
+
ensureFunction(executor, "TransportParent: executor");
|
|
216
219
|
}
|
|
217
220
|
use(value) {
|
|
218
221
|
if (this._child === void 0) {
|
|
219
222
|
throw new Error("no base transport");
|
|
220
223
|
}
|
|
221
|
-
this.executor(
|
|
224
|
+
this.executor.call(this._child, value, ...this.args);
|
|
222
225
|
return this;
|
|
223
226
|
}
|
|
224
227
|
child(transport, ...args) {
|
|
225
|
-
return new
|
|
228
|
+
return new TransportParentImpl(
|
|
226
229
|
this.executor,
|
|
227
230
|
[...this.args, ...args],
|
|
228
231
|
transport
|
|
@@ -237,32 +240,32 @@ const isAllFilled = (keysFilled, keysKnown) => {
|
|
|
237
240
|
return keysFilled.size > 0 && keysFilled.size === keysKnown.size;
|
|
238
241
|
};
|
|
239
242
|
function All(...events) {
|
|
240
|
-
return new
|
|
243
|
+
return new AllEvent(...events);
|
|
241
244
|
}
|
|
242
|
-
class
|
|
245
|
+
class AllEvent {
|
|
243
246
|
constructor(...events) {
|
|
244
|
-
__publicField$f(this, "
|
|
245
|
-
__publicField$f(this, "
|
|
247
|
+
__publicField$f(this, "known");
|
|
248
|
+
__publicField$f(this, "filled", /* @__PURE__ */ new Set());
|
|
246
249
|
__publicField$f(this, "$events");
|
|
247
|
-
__publicField$f(this, "result",
|
|
248
|
-
__publicField$f(this, "transport",
|
|
249
|
-
(
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
child.use(Object.values(this.result));
|
|
254
|
-
}
|
|
250
|
+
__publicField$f(this, "result", []);
|
|
251
|
+
__publicField$f(this, "transport", TransportParent(function(v, child, key) {
|
|
252
|
+
child.filled.add(key);
|
|
253
|
+
child.result[parseInt(key)] = v;
|
|
254
|
+
if (isAllFilled(child.filled, child.known)) {
|
|
255
|
+
this.use(child.result);
|
|
255
256
|
}
|
|
256
|
-
));
|
|
257
|
-
this.
|
|
257
|
+
}, this));
|
|
258
|
+
this.known = new Set(Object.keys(events));
|
|
258
259
|
this.$events = events;
|
|
259
260
|
}
|
|
260
261
|
event(transport) {
|
|
261
262
|
Object.entries(this.$events).forEach(([key, event]) => {
|
|
262
263
|
ensureEvent(event, "All: item");
|
|
263
|
-
this.keysKnown.add(key);
|
|
264
264
|
event.event(this.transport.child(transport, key));
|
|
265
265
|
});
|
|
266
|
+
if (this.known.size === 0) {
|
|
267
|
+
transport.use([]);
|
|
268
|
+
}
|
|
266
269
|
return this;
|
|
267
270
|
}
|
|
268
271
|
}
|
|
@@ -271,9 +274,9 @@ var __defProp$e = Object.defineProperty;
|
|
|
271
274
|
var __defNormalProp$e = (obj, key, value) => key in obj ? __defProp$e(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
272
275
|
var __publicField$e = (obj, key, value) => __defNormalProp$e(obj, key + "" , value);
|
|
273
276
|
function Any(...events) {
|
|
274
|
-
return new
|
|
277
|
+
return new AnyEvent(...events);
|
|
275
278
|
}
|
|
276
|
-
class
|
|
279
|
+
class AnyEvent {
|
|
277
280
|
constructor(...events) {
|
|
278
281
|
__publicField$e(this, "$events");
|
|
279
282
|
this.$events = events;
|
|
@@ -291,15 +294,15 @@ var __defProp$d = Object.defineProperty;
|
|
|
291
294
|
var __defNormalProp$d = (obj, key, value) => key in obj ? __defProp$d(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
292
295
|
var __publicField$d = (obj, key, value) => __defNormalProp$d(obj, key + "" , value);
|
|
293
296
|
function Applied($base, applier) {
|
|
294
|
-
return new
|
|
297
|
+
return new AppliedEvent($base, applier);
|
|
295
298
|
}
|
|
296
|
-
class
|
|
299
|
+
class AppliedEvent {
|
|
297
300
|
constructor($base, applier) {
|
|
298
301
|
this.$base = $base;
|
|
299
302
|
this.applier = applier;
|
|
300
|
-
__publicField$d(this, "transport",
|
|
301
|
-
|
|
302
|
-
}));
|
|
303
|
+
__publicField$d(this, "transport", TransportParent(function(v, child) {
|
|
304
|
+
this.use(child.applier(v));
|
|
305
|
+
}, this));
|
|
303
306
|
ensureEvent($base, "Applied: base");
|
|
304
307
|
}
|
|
305
308
|
event(transport) {
|
|
@@ -309,9 +312,9 @@ class TheApplied {
|
|
|
309
312
|
}
|
|
310
313
|
|
|
311
314
|
function Catch($base, errorMessage, errorOriginal) {
|
|
312
|
-
return new
|
|
315
|
+
return new CatchEvent($base, errorMessage, errorOriginal);
|
|
313
316
|
}
|
|
314
|
-
class
|
|
317
|
+
class CatchEvent {
|
|
315
318
|
constructor($base, errorMessage, errorOriginal) {
|
|
316
319
|
this.$base = $base;
|
|
317
320
|
this.errorMessage = errorMessage;
|
|
@@ -329,7 +332,7 @@ class TheCatch {
|
|
|
329
332
|
if (e instanceof Error) {
|
|
330
333
|
this.errorMessage.use(e.message);
|
|
331
334
|
} else {
|
|
332
|
-
this.errorMessage.use(e);
|
|
335
|
+
this.errorMessage.use(String(e));
|
|
333
336
|
}
|
|
334
337
|
if (this.errorOriginal) {
|
|
335
338
|
this.errorOriginal.use(e);
|
|
@@ -343,30 +346,28 @@ var __defProp$c = Object.defineProperty;
|
|
|
343
346
|
var __defNormalProp$c = (obj, key, value) => key in obj ? __defProp$c(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
344
347
|
var __publicField$c = (obj, key, value) => __defNormalProp$c(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
345
348
|
function Chain(...events) {
|
|
346
|
-
return new
|
|
349
|
+
return new ChainEvent(...events);
|
|
347
350
|
}
|
|
348
|
-
class
|
|
351
|
+
class ChainEvent {
|
|
349
352
|
constructor(...events) {
|
|
350
353
|
__publicField$c(this, "$events");
|
|
351
|
-
__publicField$c(this, "
|
|
354
|
+
__publicField$c(this, "$latest");
|
|
352
355
|
__publicField$c(this, "handleEvent", (index, transport) => {
|
|
353
356
|
const event = this.$events[index];
|
|
354
|
-
const
|
|
355
|
-
event.event(this.oneEventTransport.child(transport,
|
|
357
|
+
const next = this.$events[index + 1];
|
|
358
|
+
event.event(this.oneEventTransport.child(transport, next, index));
|
|
356
359
|
});
|
|
357
|
-
__publicField$c(this, "oneEventTransport",
|
|
358
|
-
(
|
|
359
|
-
|
|
360
|
-
this.lastValue = v;
|
|
361
|
-
}
|
|
362
|
-
if (this.lastValue) {
|
|
363
|
-
child.use(this.lastValue);
|
|
364
|
-
}
|
|
365
|
-
if (nextI && !this.lastValue) {
|
|
366
|
-
this.handleEvent(index + 1, child);
|
|
367
|
-
}
|
|
360
|
+
__publicField$c(this, "oneEventTransport", TransportParent(function(v, child, next, index) {
|
|
361
|
+
if (!next) {
|
|
362
|
+
child.$latest = v;
|
|
368
363
|
}
|
|
369
|
-
|
|
364
|
+
if (child.$latest) {
|
|
365
|
+
this.use(child.$latest);
|
|
366
|
+
}
|
|
367
|
+
if (next && !child.$latest) {
|
|
368
|
+
child.handleEvent(index + 1, this);
|
|
369
|
+
}
|
|
370
|
+
}, this));
|
|
370
371
|
this.$events = events;
|
|
371
372
|
}
|
|
372
373
|
event(transport) {
|
|
@@ -376,9 +377,9 @@ class TheChain {
|
|
|
376
377
|
}
|
|
377
378
|
|
|
378
379
|
function ExecutorApplied($base, applier) {
|
|
379
|
-
return new
|
|
380
|
+
return new ExecutorAppliedEvent($base, applier);
|
|
380
381
|
}
|
|
381
|
-
class
|
|
382
|
+
class ExecutorAppliedEvent {
|
|
382
383
|
constructor($base, applier) {
|
|
383
384
|
this.$base = $base;
|
|
384
385
|
this.applier = applier;
|
|
@@ -397,20 +398,20 @@ var __defProp$b = Object.defineProperty;
|
|
|
397
398
|
var __defNormalProp$b = (obj, key, value) => key in obj ? __defProp$b(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
398
399
|
var __publicField$b = (obj, key, value) => __defNormalProp$b(obj, key + "" , value);
|
|
399
400
|
function Filtered($base, predicate, defaultValue) {
|
|
400
|
-
return new
|
|
401
|
+
return new FilteredEvent($base, predicate, defaultValue);
|
|
401
402
|
}
|
|
402
|
-
class
|
|
403
|
+
class FilteredEvent {
|
|
403
404
|
constructor($base, predicate, defaultValue) {
|
|
404
405
|
this.$base = $base;
|
|
405
406
|
this.predicate = predicate;
|
|
406
407
|
this.defaultValue = defaultValue;
|
|
407
|
-
__publicField$b(this, "parent",
|
|
408
|
-
if (
|
|
409
|
-
|
|
410
|
-
} else if (
|
|
411
|
-
|
|
408
|
+
__publicField$b(this, "parent", TransportParent(function(v, child) {
|
|
409
|
+
if (child.predicate(v)) {
|
|
410
|
+
this.use(v);
|
|
411
|
+
} else if (child.defaultValue !== void 0) {
|
|
412
|
+
this.use(child.defaultValue);
|
|
412
413
|
}
|
|
413
|
-
}));
|
|
414
|
+
}, this));
|
|
414
415
|
}
|
|
415
416
|
event(transport) {
|
|
416
417
|
this.$base.event(this.parent.child(transport));
|
|
@@ -422,14 +423,14 @@ var __defProp$a = Object.defineProperty;
|
|
|
422
423
|
var __defNormalProp$a = (obj, key, value) => key in obj ? __defProp$a(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
423
424
|
var __publicField$a = (obj, key, value) => __defNormalProp$a(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
424
425
|
function FromEvent($emitter, $eventName, $subscribeMethod, $unsubscribeMethod) {
|
|
425
|
-
return new
|
|
426
|
+
return new FromEventAdapter(
|
|
426
427
|
$emitter,
|
|
427
428
|
$eventName,
|
|
428
429
|
$subscribeMethod,
|
|
429
430
|
$unsubscribeMethod
|
|
430
431
|
);
|
|
431
432
|
}
|
|
432
|
-
class
|
|
433
|
+
class FromEventAdapter {
|
|
433
434
|
constructor($emitter, $eventName, $subscribeMethod, $unsubscribeMethod) {
|
|
434
435
|
this.$emitter = $emitter;
|
|
435
436
|
this.$eventName = $eventName;
|
|
@@ -441,19 +442,18 @@ class TheFromEvent {
|
|
|
441
442
|
this.lastTransport.use(v);
|
|
442
443
|
}
|
|
443
444
|
});
|
|
444
|
-
__publicField$a(this, "parent",
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
return;
|
|
449
|
-
}
|
|
450
|
-
emitter[subscribe](eventName, this.handler);
|
|
445
|
+
__publicField$a(this, "parent", TransportParent(function([emitter, eventName, subscribe], child) {
|
|
446
|
+
child.lastTransport = this;
|
|
447
|
+
if (!emitter?.[subscribe]) {
|
|
448
|
+
return;
|
|
451
449
|
}
|
|
452
|
-
|
|
450
|
+
emitter[subscribe](eventName, child.handler);
|
|
451
|
+
}, this));
|
|
453
452
|
}
|
|
454
453
|
event(transport) {
|
|
455
|
-
|
|
456
|
-
|
|
454
|
+
All(this.$emitter, this.$eventName, this.$subscribeMethod).event(
|
|
455
|
+
this.parent.child(transport)
|
|
456
|
+
);
|
|
457
457
|
return this;
|
|
458
458
|
}
|
|
459
459
|
destroy() {
|
|
@@ -461,8 +461,7 @@ class TheFromEvent {
|
|
|
461
461
|
if (!this.$unsubscribeMethod) {
|
|
462
462
|
return this;
|
|
463
463
|
}
|
|
464
|
-
|
|
465
|
-
a.event(
|
|
464
|
+
All(this.$emitter, this.$eventName, this.$unsubscribeMethod).event(
|
|
466
465
|
Transport(([emitter, eventName, unsubscribe]) => {
|
|
467
466
|
emitter?.[unsubscribe]?.(eventName, this.handler);
|
|
468
467
|
})
|
|
@@ -471,19 +470,19 @@ class TheFromEvent {
|
|
|
471
470
|
}
|
|
472
471
|
}
|
|
473
472
|
|
|
474
|
-
function FromPromise(p,
|
|
475
|
-
return new
|
|
473
|
+
function FromPromise(p, error) {
|
|
474
|
+
return new FromPromiseEvent(p, error);
|
|
476
475
|
}
|
|
477
|
-
class
|
|
478
|
-
constructor(p,
|
|
476
|
+
class FromPromiseEvent {
|
|
477
|
+
constructor(p, error) {
|
|
479
478
|
this.p = p;
|
|
480
|
-
this.
|
|
479
|
+
this.error = error;
|
|
481
480
|
}
|
|
482
481
|
event(transport) {
|
|
483
|
-
this.p.then(
|
|
482
|
+
this.p.then((v) => {
|
|
484
483
|
transport.use(v);
|
|
485
484
|
}).catch((e) => {
|
|
486
|
-
this.
|
|
485
|
+
this.error?.use(e);
|
|
487
486
|
});
|
|
488
487
|
return this;
|
|
489
488
|
}
|
|
@@ -493,9 +492,9 @@ var __defProp$9 = Object.defineProperty;
|
|
|
493
492
|
var __defNormalProp$9 = (obj, key, value) => key in obj ? __defProp$9(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
494
493
|
var __publicField$9 = (obj, key, value) => __defNormalProp$9(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
495
494
|
function Late(v) {
|
|
496
|
-
return new
|
|
495
|
+
return new LateEvent(v);
|
|
497
496
|
}
|
|
498
|
-
class
|
|
497
|
+
class LateEvent {
|
|
499
498
|
constructor(v) {
|
|
500
499
|
this.v = v;
|
|
501
500
|
__publicField$9(this, "lateTransport", null);
|
|
@@ -525,18 +524,18 @@ var __defProp$8 = Object.defineProperty;
|
|
|
525
524
|
var __defNormalProp$8 = (obj, key, value) => key in obj ? __defProp$8(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
526
525
|
var __publicField$8 = (obj, key, value) => __defNormalProp$8(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
527
526
|
function Once($base) {
|
|
528
|
-
return new
|
|
527
|
+
return new OnceEvent($base);
|
|
529
528
|
}
|
|
530
|
-
class
|
|
529
|
+
class OnceEvent {
|
|
531
530
|
constructor($base) {
|
|
532
531
|
this.$base = $base;
|
|
533
532
|
__publicField$8(this, "isFilled", false);
|
|
534
|
-
__publicField$8(this, "parent",
|
|
535
|
-
if (!
|
|
536
|
-
|
|
537
|
-
|
|
533
|
+
__publicField$8(this, "parent", TransportParent(function(v, child) {
|
|
534
|
+
if (!child.isFilled) {
|
|
535
|
+
child.isFilled = true;
|
|
536
|
+
this.use(v);
|
|
538
537
|
}
|
|
539
|
-
}));
|
|
538
|
+
}, this));
|
|
540
539
|
}
|
|
541
540
|
event(transport) {
|
|
542
541
|
this.$base.event(this.parent.child(transport));
|
|
@@ -548,9 +547,9 @@ var __defProp$7 = Object.defineProperty;
|
|
|
548
547
|
var __defNormalProp$7 = (obj, key, value) => key in obj ? __defProp$7(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
549
548
|
var __publicField$7 = (obj, key, value) => __defNormalProp$7(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
550
549
|
function Shared($base, stateless = false) {
|
|
551
|
-
return new
|
|
550
|
+
return new SharedEvent($base, stateless);
|
|
552
551
|
}
|
|
553
|
-
class
|
|
552
|
+
class SharedEvent {
|
|
554
553
|
constructor($base, stateless = false) {
|
|
555
554
|
this.$base = $base;
|
|
556
555
|
this.stateless = stateless;
|
|
@@ -596,9 +595,9 @@ var __defProp$6 = Object.defineProperty;
|
|
|
596
595
|
var __defNormalProp$6 = (obj, key, value) => key in obj ? __defProp$6(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
597
596
|
var __publicField$6 = (obj, key, value) => __defNormalProp$6(obj, key + "" , value);
|
|
598
597
|
function SharedSource($base, stateless = false) {
|
|
599
|
-
return new
|
|
598
|
+
return new SharedSourceEvent($base, stateless);
|
|
600
599
|
}
|
|
601
|
-
class
|
|
600
|
+
class SharedSourceEvent {
|
|
602
601
|
constructor($base, stateless = false) {
|
|
603
602
|
this.$base = $base;
|
|
604
603
|
__publicField$6(this, "$sharedBase");
|
|
@@ -619,9 +618,9 @@ var __defProp$5 = Object.defineProperty;
|
|
|
619
618
|
var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
620
619
|
var __publicField$5 = (obj, key, value) => __defNormalProp$5(obj, key + "" , value);
|
|
621
620
|
function LateShared(value) {
|
|
622
|
-
return new
|
|
621
|
+
return new LateSharedEvent(value);
|
|
623
622
|
}
|
|
624
|
-
class
|
|
623
|
+
class LateSharedEvent {
|
|
625
624
|
constructor(value) {
|
|
626
625
|
__publicField$5(this, "$event");
|
|
627
626
|
this.$event = SharedSource(Late(value));
|
|
@@ -640,25 +639,24 @@ var __defProp$4 = Object.defineProperty;
|
|
|
640
639
|
var __defNormalProp$4 = (obj, key, value) => key in obj ? __defProp$4(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
641
640
|
var __publicField$4 = (obj, key, value) => __defNormalProp$4(obj, key + "" , value);
|
|
642
641
|
function Map($base, $target) {
|
|
643
|
-
return new
|
|
642
|
+
return new MapEvent($base, $target);
|
|
644
643
|
}
|
|
645
|
-
class
|
|
644
|
+
class MapEvent {
|
|
646
645
|
constructor($base, $target) {
|
|
647
646
|
this.$base = $base;
|
|
648
647
|
this.$target = $target;
|
|
649
|
-
__publicField$4(this, "parent",
|
|
648
|
+
__publicField$4(this, "parent", TransportParent(function(v, child) {
|
|
650
649
|
const infos = [];
|
|
651
650
|
v.forEach((val) => {
|
|
652
|
-
let
|
|
653
|
-
if (!isEvent(
|
|
654
|
-
|
|
651
|
+
let $val = val;
|
|
652
|
+
if (!isEvent($val)) {
|
|
653
|
+
$val = Of($val);
|
|
655
654
|
}
|
|
656
|
-
const info =
|
|
655
|
+
const info = child.$target.use($val);
|
|
657
656
|
infos.push(info);
|
|
658
657
|
});
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
}));
|
|
658
|
+
All(...infos).event(this);
|
|
659
|
+
}, this));
|
|
662
660
|
}
|
|
663
661
|
event(transport) {
|
|
664
662
|
this.$base.event(this.parent.child(transport));
|
|
@@ -670,9 +668,9 @@ var __defProp$3 = Object.defineProperty;
|
|
|
670
668
|
var __defNormalProp$3 = (obj, key, value) => key in obj ? __defProp$3(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
671
669
|
var __publicField$3 = (obj, key, value) => __defNormalProp$3(obj, key + "" , value);
|
|
672
670
|
function Primitive($base, theValue = null) {
|
|
673
|
-
return new
|
|
671
|
+
return new PrimitiveImpl($base, theValue);
|
|
674
672
|
}
|
|
675
|
-
class
|
|
673
|
+
class PrimitiveImpl {
|
|
676
674
|
constructor($base, theValue = null) {
|
|
677
675
|
this.$base = $base;
|
|
678
676
|
this.theValue = theValue;
|
|
@@ -709,16 +707,16 @@ var __defProp$2 = Object.defineProperty;
|
|
|
709
707
|
var __defNormalProp$2 = (obj, key, value) => key in obj ? __defProp$2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
710
708
|
var __publicField$2 = (obj, key, value) => __defNormalProp$2(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
711
709
|
function Sequence($base) {
|
|
712
|
-
return new
|
|
710
|
+
return new SequenceEvent($base);
|
|
713
711
|
}
|
|
714
|
-
class
|
|
712
|
+
class SequenceEvent {
|
|
715
713
|
constructor($base) {
|
|
716
714
|
this.$base = $base;
|
|
717
715
|
__publicField$2(this, "result", []);
|
|
718
|
-
__publicField$2(this, "parent",
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
}));
|
|
716
|
+
__publicField$2(this, "parent", TransportParent(function(v, child) {
|
|
717
|
+
child.result.push(v);
|
|
718
|
+
this.use(child.result);
|
|
719
|
+
}, this));
|
|
722
720
|
}
|
|
723
721
|
event(transport) {
|
|
724
722
|
this.$base.event(this.parent.child(transport));
|
|
@@ -730,14 +728,14 @@ var __defProp$1 = Object.defineProperty;
|
|
|
730
728
|
var __defNormalProp$1 = (obj, key, value) => key in obj ? __defProp$1(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
731
729
|
var __publicField$1 = (obj, key, value) => __defNormalProp$1(obj, key + "" , value);
|
|
732
730
|
function Stream($base) {
|
|
733
|
-
return new
|
|
731
|
+
return new StreamEvent($base);
|
|
734
732
|
}
|
|
735
|
-
class
|
|
733
|
+
class StreamEvent {
|
|
736
734
|
constructor($base) {
|
|
737
735
|
this.$base = $base;
|
|
738
|
-
__publicField$1(this, "parent",
|
|
736
|
+
__publicField$1(this, "parent", TransportParent(function(v) {
|
|
739
737
|
v.forEach((cv) => {
|
|
740
|
-
|
|
738
|
+
this.use(cv);
|
|
741
739
|
});
|
|
742
740
|
}));
|
|
743
741
|
}
|
|
@@ -748,9 +746,9 @@ class TheStream {
|
|
|
748
746
|
}
|
|
749
747
|
|
|
750
748
|
function TransportApplied(baseTransport, applier) {
|
|
751
|
-
return new
|
|
749
|
+
return new TransportAppliedImpl(baseTransport, applier);
|
|
752
750
|
}
|
|
753
|
-
class
|
|
751
|
+
class TransportAppliedImpl {
|
|
754
752
|
constructor(baseTransport, applier) {
|
|
755
753
|
this.baseTransport = baseTransport;
|
|
756
754
|
this.applier = applier;
|
|
@@ -761,9 +759,9 @@ class TheTransportApplied {
|
|
|
761
759
|
}
|
|
762
760
|
|
|
763
761
|
function TransportArgs(baseTransport, args, startFromArgIndex = 0) {
|
|
764
|
-
return new
|
|
762
|
+
return new TransportArgsImpl(baseTransport, args, startFromArgIndex);
|
|
765
763
|
}
|
|
766
|
-
class
|
|
764
|
+
class TransportArgsImpl {
|
|
767
765
|
constructor(baseTransport, args, startFromArgIndex = 0) {
|
|
768
766
|
this.baseTransport = baseTransport;
|
|
769
767
|
this.args = args;
|
|
@@ -785,9 +783,9 @@ var __defProp = Object.defineProperty;
|
|
|
785
783
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
786
784
|
var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
|
|
787
785
|
function TransportDestroyable(baseTransport) {
|
|
788
|
-
return new
|
|
786
|
+
return new TransportDestroyableEvent(baseTransport);
|
|
789
787
|
}
|
|
790
|
-
class
|
|
788
|
+
class TransportDestroyableEvent {
|
|
791
789
|
constructor(baseTransport) {
|
|
792
790
|
this.baseTransport = baseTransport;
|
|
793
791
|
__publicField(this, "destructors", []);
|
|
@@ -810,6 +808,7 @@ exports.Any = Any;
|
|
|
810
808
|
exports.Applied = Applied;
|
|
811
809
|
exports.Catch = Catch;
|
|
812
810
|
exports.Chain = Chain;
|
|
811
|
+
exports.ChainEvent = ChainEvent;
|
|
813
812
|
exports.Component = Component;
|
|
814
813
|
exports.ComponentClass = ComponentClass;
|
|
815
814
|
exports.DestroyContainer = DestroyContainer;
|
|
@@ -818,6 +817,7 @@ exports.ExecutorApplied = ExecutorApplied;
|
|
|
818
817
|
exports.Filtered = Filtered;
|
|
819
818
|
exports.FromEvent = FromEvent;
|
|
820
819
|
exports.FromPromise = FromPromise;
|
|
820
|
+
exports.FromPromiseEvent = FromPromiseEvent;
|
|
821
821
|
exports.Late = Late;
|
|
822
822
|
exports.LateShared = LateShared;
|
|
823
823
|
exports.Local = Local;
|
|
@@ -825,21 +825,19 @@ exports.Map = Map;
|
|
|
825
825
|
exports.Of = Of;
|
|
826
826
|
exports.Once = Once;
|
|
827
827
|
exports.OwnerPool = OwnerPool;
|
|
828
|
-
exports.ParentTransport = ParentTransport;
|
|
829
828
|
exports.Primitive = Primitive;
|
|
830
829
|
exports.Sequence = Sequence;
|
|
831
830
|
exports.Shared = Shared;
|
|
832
831
|
exports.SharedSource = SharedSource;
|
|
833
832
|
exports.Stream = Stream;
|
|
834
|
-
exports.TheChain = TheChain;
|
|
835
|
-
exports.TheFromPromise = TheFromPromise;
|
|
836
|
-
exports.TheTransportApplied = TheTransportApplied;
|
|
837
|
-
exports.TheTransportArgs = TheTransportArgs;
|
|
838
833
|
exports.Transport = Transport;
|
|
839
834
|
exports.TransportApplied = TransportApplied;
|
|
835
|
+
exports.TransportAppliedImpl = TransportAppliedImpl;
|
|
840
836
|
exports.TransportArgs = TransportArgs;
|
|
837
|
+
exports.TransportArgsImpl = TransportArgsImpl;
|
|
841
838
|
exports.TransportDestroyable = TransportDestroyable;
|
|
842
839
|
exports.TransportEvent = TransportEvent;
|
|
840
|
+
exports.TransportParent = TransportParent;
|
|
843
841
|
exports.Void = Void;
|
|
844
842
|
exports.ensureEvent = ensureEvent;
|
|
845
843
|
exports.ensureFunction = ensureFunction;
|