commit | ebec31d19d829d93e5e0a96db3e54036c5bd1450 | [log] [tgz] |
---|---|---|
author | Idan Amit <idan.amit@intl.att.com> | Sun Jan 06 13:07:18 2019 +0200 |
committer | Idan Amit <idan.amit@intl.att.com> | Mon Jan 07 17:34:23 2019 +0200 |
tree | c48e474198d15b062a73e238de7cfd4505b82b54 | |
parent | bbeb590aaff56ff3364b852f6149b220581b58a1 [diff] |
Fixed readme issue Change-Id: I27c560f081daca8129534cc32bc869a24ec73b88 Issue-ID: SDC-2032 Signed-off-by: Idan Amit <idan.amit@intl.att.com>
sdc-pubsub npm package.
Installing using npm:
npm install sdc-pubsub
import {PluginPubSub} from 'sdc-pubsub'
<!-- index.html --> <script src="./node_modules/sdc-pubsub/dist/sdc-pubsub.js"></script>
// script.js var pubsub = window.sdcPubSub.PluginPubSub;
// eventsClientId = client id to be used by the event bus, received from query params // parentUrl = event bus location url for communication, received from query params // eventsToWaitFor = list of events names that the event hub should wait for their completion. // the client should send an "ACTION_COMPLETED" event to the hub in order to notify the event hub to continue with the flow. // For example: [ “CHECK_IN” ] var client = new PluginPubSub('eventsClientId, parentUrl, eventsToWaitFor')
client.notify(“READY”)
// When lisetning to event we have to specify the specific event we want to act once it being received. // eventData.type will hold the event name that was notified by someone else client.on((eventData,event) => { if(eventData.type == ”WINDOW_OUT”) { //do logic } } )
None.
None.
Copyright 2018 AT&T, Inc.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0