@holo-js/events 0.2.6 → 0.3.1
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.mjs +7 -0
- package/package.json +4 -4
package/dist/index.mjs
CHANGED
|
@@ -678,6 +678,12 @@ function splitListenersForExecution(listeners, forceAfterCommit) {
|
|
|
678
678
|
deferredQueuedListeners: Object.freeze(deferredQueuedListeners)
|
|
679
679
|
});
|
|
680
680
|
}
|
|
681
|
+
function validateQueuedPayloadForExecutionGroups(groups, payload) {
|
|
682
|
+
if (groups.immediateQueuedListeners.length === 0 && groups.deferredQueuedListeners.length === 0) {
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
validateQueuedEventPayload(payload);
|
|
686
|
+
}
|
|
681
687
|
function scheduleDeferredDispatch(callback, eventName) {
|
|
682
688
|
const defer = getRuntimeState().hooks.defer ?? deferEventDispatchToDatabaseCommit;
|
|
683
689
|
return defer(callback, {
|
|
@@ -691,6 +697,7 @@ async function executeDispatch(event, payload, options = {}) {
|
|
|
691
697
|
const envelope = createEventEnvelope(eventName, payload);
|
|
692
698
|
const listeners = listRegisteredListenersForEvent(eventName);
|
|
693
699
|
const groups = splitListenersForExecution(listeners, options.afterCommit === true);
|
|
700
|
+
validateQueuedPayloadForExecutionGroups(groups, envelope.payload);
|
|
694
701
|
if (options.afterCommit) {
|
|
695
702
|
const scheduled = scheduleDeferredDispatch(async () => {
|
|
696
703
|
await executeListenerGroups(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@holo-js/events",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Holo-JS Framework - event contracts and runtime surface",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"test": "vitest --run"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@holo-js/db": "^0.
|
|
26
|
+
"@holo-js/db": "^0.3.1"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@holo-js/queue": "^0.
|
|
29
|
+
"@holo-js/queue": "^0.3.1"
|
|
30
30
|
},
|
|
31
31
|
"peerDependenciesMeta": {
|
|
32
32
|
"@holo-js/queue": {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@holo-js/queue": "^0.
|
|
37
|
+
"@holo-js/queue": "^0.3.1",
|
|
38
38
|
"@types/node": "^22.10.2",
|
|
39
39
|
"tsup": "^8.3.5",
|
|
40
40
|
"typescript": "^5.7.2",
|