@cadenza.io/core 3.16.3 → 3.16.4
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/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +12 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -817,6 +817,7 @@ declare class Task extends SignalEmitter implements Graph {
|
|
|
817
817
|
signalsToEmitAfter: Set<string>;
|
|
818
818
|
signalsToEmitOnFail: Set<string>;
|
|
819
819
|
observedSignals: Set<string>;
|
|
820
|
+
intents: Set<string>;
|
|
820
821
|
readonly taskFunction: TaskFunction;
|
|
821
822
|
/**
|
|
822
823
|
* Constructs an instance of the task with the specified properties and configuration options.
|
|
@@ -1052,6 +1053,7 @@ declare class Task extends SignalEmitter implements Graph {
|
|
|
1052
1053
|
* @return {this} Returns the current instance to allow method chaining.
|
|
1053
1054
|
*/
|
|
1054
1055
|
detachAllSignals(): this;
|
|
1056
|
+
handlesIntent(intent: string): this;
|
|
1055
1057
|
/**
|
|
1056
1058
|
* Maps over the signals in the `signalsToEmitAfter` set and applies a callback function to each signal.
|
|
1057
1059
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -817,6 +817,7 @@ declare class Task extends SignalEmitter implements Graph {
|
|
|
817
817
|
signalsToEmitAfter: Set<string>;
|
|
818
818
|
signalsToEmitOnFail: Set<string>;
|
|
819
819
|
observedSignals: Set<string>;
|
|
820
|
+
intents: Set<string>;
|
|
820
821
|
readonly taskFunction: TaskFunction;
|
|
821
822
|
/**
|
|
822
823
|
* Constructs an instance of the task with the specified properties and configuration options.
|
|
@@ -1052,6 +1053,7 @@ declare class Task extends SignalEmitter implements Graph {
|
|
|
1052
1053
|
* @return {this} Returns the current instance to allow method chaining.
|
|
1053
1054
|
*/
|
|
1054
1055
|
detachAllSignals(): this;
|
|
1056
|
+
handlesIntent(intent: string): this;
|
|
1055
1057
|
/**
|
|
1056
1058
|
* Maps over the signals in the `signalsToEmitAfter` set and applies a callback function to each signal.
|
|
1057
1059
|
*
|
package/dist/index.js
CHANGED
|
@@ -1482,7 +1482,7 @@ var SignalBroker = class _SignalBroker {
|
|
|
1482
1482
|
* @return {void} Does not return a value.
|
|
1483
1483
|
*/
|
|
1484
1484
|
squash(signal, context, options = { squash: true }) {
|
|
1485
|
-
let { squashId, delayMs =
|
|
1485
|
+
let { squashId, delayMs = 300 } = options;
|
|
1486
1486
|
if (!squashId) {
|
|
1487
1487
|
squashId = signal;
|
|
1488
1488
|
}
|
|
@@ -1493,7 +1493,7 @@ var SignalBroker = class _SignalBroker {
|
|
|
1493
1493
|
this.emit(signal, this.squashedContexts.get(squashId));
|
|
1494
1494
|
this.squashedEmitters.delete(squashId);
|
|
1495
1495
|
this.squashedContexts.delete(squashId);
|
|
1496
|
-
}, delayMs ??
|
|
1496
|
+
}, delayMs ?? 300)
|
|
1497
1497
|
);
|
|
1498
1498
|
this.squashedContexts.set(squashId, context);
|
|
1499
1499
|
} else {
|
|
@@ -2078,7 +2078,7 @@ var SignalEmitter = class {
|
|
|
2078
2078
|
* @param options
|
|
2079
2079
|
*/
|
|
2080
2080
|
emit(signal, data = {}, options = {}) {
|
|
2081
|
-
Cadenza.broker.emit(signal, data);
|
|
2081
|
+
Cadenza.broker.emit(signal, data, options);
|
|
2082
2082
|
}
|
|
2083
2083
|
/**
|
|
2084
2084
|
* Emits a signal via the broker if not silent.
|
|
@@ -2090,7 +2090,7 @@ var SignalEmitter = class {
|
|
|
2090
2090
|
if (this.silent) {
|
|
2091
2091
|
return;
|
|
2092
2092
|
}
|
|
2093
|
-
Cadenza.broker.emit(signal, data);
|
|
2093
|
+
Cadenza.broker.emit(signal, data, options);
|
|
2094
2094
|
}
|
|
2095
2095
|
};
|
|
2096
2096
|
|
|
@@ -3481,6 +3481,7 @@ var Task = class _Task extends SignalEmitter {
|
|
|
3481
3481
|
this.signalsToEmitAfter = /* @__PURE__ */ new Set();
|
|
3482
3482
|
this.signalsToEmitOnFail = /* @__PURE__ */ new Set();
|
|
3483
3483
|
this.observedSignals = /* @__PURE__ */ new Set();
|
|
3484
|
+
this.intents = /* @__PURE__ */ new Set();
|
|
3484
3485
|
this.name = name;
|
|
3485
3486
|
this.taskFunction = task;
|
|
3486
3487
|
this.description = description;
|
|
@@ -3557,6 +3558,9 @@ var Task = class _Task extends SignalEmitter {
|
|
|
3557
3558
|
signalsToEmitAfter: Array.from(this.signalsToEmitAfter),
|
|
3558
3559
|
signalsToEmitOnFail: Array.from(this.signalsToEmitOnFail),
|
|
3559
3560
|
observed: Array.from(this.observedSignals)
|
|
3561
|
+
},
|
|
3562
|
+
intents: {
|
|
3563
|
+
handles: Array.from(this.intents)
|
|
3560
3564
|
}
|
|
3561
3565
|
},
|
|
3562
3566
|
taskInstance: this,
|
|
@@ -4211,6 +4215,10 @@ var Task = class _Task extends SignalEmitter {
|
|
|
4211
4215
|
this.signalsToEmitAfter.clear();
|
|
4212
4216
|
return this;
|
|
4213
4217
|
}
|
|
4218
|
+
handlesIntent(intent) {
|
|
4219
|
+
this.intents.add(intent);
|
|
4220
|
+
return this;
|
|
4221
|
+
}
|
|
4214
4222
|
/**
|
|
4215
4223
|
* Maps over the signals in the `signalsToEmitAfter` set and applies a callback function to each signal.
|
|
4216
4224
|
*
|