6 Commits

Author SHA1 Message Date
a34e8f571d 1.0.11 2021-09-27 13:51:00 +02:00
2bf398cf97 fix(core): update 2021-09-27 13:50:59 +02:00
315bbffac2 1.0.10 2021-09-27 12:27:21 +02:00
52e77d1c3e fix(core): update 2021-09-27 12:27:20 +02:00
9ac1fdbb63 1.0.9 2020-12-21 12:07:35 +00:00
ac43f63daf fix(core): update 2020-12-21 12:07:34 +00:00
6 changed files with 17999 additions and 3806 deletions

21764
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{
"name": "@designestate/dees-comms",
"version": "1.0.8",
"version": "1.0.11",
"private": false,
"description": "a comms module for communicating within the DOM",
"main": "dist_ts/index.js",
@@ -9,21 +9,21 @@
"license": "MIT",
"scripts": {
"test": "(tstest test/ --web)",
"build": "(tsbuild --web)"
"build": "(tsbuild --web && tsbundle npm)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsbundle": "^1.0.78",
"@gitzone/tstest": "^1.0.52",
"@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.14.14",
"@gitzone/tsbuild": "^2.1.27",
"@gitzone/tsbundle": "^1.0.87",
"@gitzone/tstest": "^1.0.57",
"@pushrocks/tapbundle": "^3.2.14",
"@types/node": "^16.10.1",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
},
"dependencies": {
"@apiglobal/typedrequest": "^1.0.56",
"@apiglobal/typedrequest": "^1.0.58",
"@apiglobal/typedrequest-interfaces": "^1.0.15",
"broadcast-channel": "^3.3.0"
"broadcast-channel": "^3.7.0"
},
"files": [
"ts/**/*",

View File

@@ -6,13 +6,13 @@ let deesCommsTest: deesComms.DeesComms;
tap.test('first test', async (tools) => {
deesCommsTest = new deesComms.DeesComms();
deesCommsTest.createTypedHandler<any>('test', async (requestData) => {
return {'hitheretoo': `greetings to ${requestData.hithere}`};
return { hitheretoo: `greetings to ${requestData.hithere}` };
});
// lets fire a request
const typedrequest = deesCommsTest.createTypedRequest<any>('test');
const result = await typedrequest.fire({
'hithere': 'hello'
hithere: 'hello',
});
console.log(JSON.stringify(result));
});

View File

@@ -17,8 +17,8 @@ export class DeesComms {
postMethodWithTypedRouter: async (messageArg) => {
this.postMessage(messageArg);
},
typedRouterRef: this.typedrouter
})
typedRouterRef: this.typedrouter,
});
private subscriptionChannel = new BroadcastChannel('dees-comms');
@@ -39,10 +39,7 @@ export class DeesComms {
public createTypedRequest<T extends plugins.typedrequestInterfaces.ITypedRequest>(
methodName: T['method']
): TypedRequest<T> {
const typedrequest = new plugins.typedrequest.TypedRequest(
this.typedtarget,
methodName
);
const typedrequest = new plugins.typedrequest.TypedRequest(this.typedtarget, methodName);
return typedrequest;
}
@@ -62,6 +59,8 @@ export class DeesComms {
methodArg: T['method'],
handlerFunction: plugins.typedrequest.THandlerFunction<T>
) {
this.typedrouter.addTypedHandler(new plugins.typedrequest.TypedHandler<T>(methodArg, handlerFunction));
this.typedrouter.addTypedHandler(
new plugins.typedrequest.TypedHandler<T>(methodArg, handlerFunction)
);
}
}

View File

@@ -7,6 +7,4 @@ export { typedrequestInterfaces, typedrequest };
// thirdparty scope
import { BroadcastChannel as BroadCastChannelPolyfill } from 'broadcast-channel';
export {
BroadCastChannelPolyfill
};
export { BroadCastChannelPolyfill };

View File

@@ -1 +1 @@
export * from './dees-comms.classes.deescomms';
export * from './dees-comms.classes.deescomms';