<Gpx> component

This commit is contained in:
vdv committed 2022-11-27 15:50:08 +01:00
1 parent 346b9a1186
commit 79fb39100f
7 files changed
+76 -22

No files matched your search

+2 -1
View File
@@ -25,6 +25,7 @@ const dispatch = (
payload: any,
callBack?: (error: any, result: any) => void
) => {
console.log({ caller: 'dispatcher-main / dispatch', payload });
if (worker === undefined) {
init();
}
@@ -47,7 +48,7 @@ const dispatch = (
payload: payload,
};
worker.postMessage(message);
console.log({ caller: 'dispatcher-main / dispatch', message });
console.log({ caller: 'dispatcher-main / message sent', message });
};
export default dispatch;
+1 -1
View File
@@ -31,7 +31,6 @@ console.log({ caller: 'dispatcher-worker', actions });
onmessage = async function (e) {
console.log({ caller: 'dispatcher-worker / onmessage', e });
const { id, payload } = e.data;
console.log(`payload.action in actions: ${payload.action in actions}`);
var returnValue: any = 'unknownAction';
if (payload.action in actions) {
returnValue = await actions[<keyof typeof actions>payload.action](
@@ -39,6 +38,7 @@ onmessage = async function (e) {
);
}
postMessage({ id: id, payload: returnValue });
console.log({ caller: 'dispatcher-worker / response sent', id, returnValue });
};
//export default self;