fix(core): update

This commit is contained in:
2022-03-29 10:01:50 +02:00
parent 4c59d38971
commit 758dcd671c
5 changed files with 35 additions and 221 deletions

View File

@ -20,11 +20,12 @@ export class DeesComms {
typedRouterRef: this.typedrouter,
});
// receiving messages
private subscriptionChannel = new BroadcastChannel('dees-comms');
constructor() {
this.subscriptionChannel.onmessage = async (eventArg) => {
const message = eventArg.data;
const message = (eventArg as any).method ? eventArg : eventArg.data;
console.log(JSON.stringify(message));
const response = await this.typedrouter.routeAndAddResponse(message);
if (response) {

View File

@ -1,8 +1,9 @@
// pushrocks scope
import * as smartdelay from '@pushrocks/smartdelay';
import * as typedrequestInterfaces from '@apiglobal/typedrequest-interfaces';
import * as typedrequest from '@apiglobal/typedrequest';
export { typedrequestInterfaces, typedrequest };
export { smartdelay, typedrequestInterfaces, typedrequest };
// third party scope
import { BroadcastChannel as BroadCastChannelPolyfill } from 'broadcast-channel';