From 548c5a220333c7cd666b861e737bff0b45461f18 Mon Sep 17 00:00:00 2001 From: "Stone, Avi (as206k)" Date: Sun, 3 Jun 2018 13:12:12 +0300 Subject: Update FE project Update FE to latest version so that fe can run on docker Change-Id: I9c5dee756b567dbe64fac6d3d6fd89362813bdcc Issue-ID: SDC-1359 Signed-off-by: Stone, Avi (as206k) --- public/src/app/sdc/plugin-pubsub.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 public/src/app/sdc/plugin-pubsub.ts (limited to 'public/src/app/sdc/plugin-pubsub.ts') diff --git a/public/src/app/sdc/plugin-pubsub.ts b/public/src/app/sdc/plugin-pubsub.ts new file mode 100644 index 0000000..848c7d2 --- /dev/null +++ b/public/src/app/sdc/plugin-pubsub.ts @@ -0,0 +1,32 @@ +import { BasePubSub } from './base-pubsub'; + +declare const window: Window; + +export class PluginPubSub extends BasePubSub { + constructor( + pluginId: string, + parentUrl: string, + eventsToWait?: Array + ) { + super(pluginId); + this.register('sdc-hub', window.parent, parentUrl); + this.subscribe(eventsToWait); + } + + public subscribe(eventsToWait?: Array) { + const registerData = { + pluginId: this.clientId, + eventsToWait: eventsToWait || [] + }; + + this.notify('PLUGIN_REGISTER', registerData); + } + + public unsubscribe() { + const unregisterData = { + pluginId: this.clientId + }; + + this.notify('PLUGIN_UNREGISTER', unregisterData); + } +} -- cgit 1.2.3-korg