daggerheart/module/helpers/socket.mjs
2025-05-22 16:53:39 +02:00

20 lines
No EOL
556 B
JavaScript

export function handleSocketEvent({action=null, data={}}={}) {
switch (action) {
case socketEvent.GMUpdate:
Hooks.callAll(socketEvent.GMUpdate, data.action, data.uuid, data.update);
break;
case socketEvent.DhpFearUpdate:
Hooks.callAll(socketEvent.DhpFearUpdate);
break;
}
}
export const socketEvent = {
GMUpdate: "DhpGMUpdate",
DhpFearUpdate: "DhpFearUpdate",
};
export const GMUpdateEvent = {
UpdateDocument: "DhpGMUpdateDocument",
UpdateFear: "DhpUpdateFear"
};