fix(core): update

This commit is contained in:
2020-12-21 12:07:18 +00:00
parent 20dcc9dc00
commit 336351b98a
4 changed files with 48 additions and 35 deletions

View File

@ -13,6 +13,12 @@ export class DeesComms {
// sending messages
private postChannel = new BroadcastChannel('dees-comms');
public typedrouter = new plugins.typedrequest.TypedRouter();
public typedtarget = new plugins.typedrequest.TypedTarget({
postMethodWithTypedRouter: async (messageArg) => {
this.postMessage(messageArg);
},
typedRouterRef: this.typedrouter
})
private subscriptionChannel = new BroadcastChannel('dees-comms');
@ -34,11 +40,8 @@ export class DeesComms {
methodName: T['method']
): TypedRequest<T> {
const typedrequest = new plugins.typedrequest.TypedRequest(
async (messageArg) => {
this.postMessage(messageArg);
},
methodName,
this.typedrouter
this.typedtarget,
methodName
);
return typedrequest;
}