1.0.30 • Published 6 years ago
sdc-pubsub v1.0.30
sdc-pubsub
sdc-pubsub npm package.
Installation
Installing using npm:
npm install sdc-pubsub
Loading It Up
CommonJS
import {PluginPubSub} from 'sdc-pubsub'
Global Variable
<!-- index.html -->
<script src="./node_modules/sdc-pubsub/dist/sdc-pubsub.js"></script>
// script.js
var pubsub = window.sdcPubSub.PluginPubSub;
Usage
Initialize a pubsub client
// 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')
Notify about events
client.notify(“READY”)
Register for an event
// 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
}
}
)
Dependencies
None.
Tests
None.
Authors
- Idan Amit: https://wiki.onap.org/display/~idanamit
Links
- SDC onap wiki https://wiki.onap.org/x/_TX0
- Generic designer support document https://wiki.onap.org/display/DW/Generic+Designer+Support
- Repository https://gerrit.onap.org/r/gitweb?p=sdc/sdc-pubsub.git;a=summary
License
Copyright 2018 AT&T, Inc.
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
1.0.30
6 years ago
1.0.29
6 years ago
1.0.28
6 years ago
1.0.27
6 years ago
1.0.26
7 years ago
1.0.25
7 years ago
1.0.24
7 years ago
1.0.23
7 years ago
1.0.22
7 years ago
1.0.21
7 years ago
1.0.20
7 years ago
1.0.19
7 years ago
1.0.18
7 years ago
1.0.17
7 years ago
1.0.16
7 years ago
1.0.15
7 years ago
1.0.14
7 years ago
1.0.13
7 years ago
1.0.12
7 years ago
1.0.11
7 years ago
1.0.10
7 years ago
1.0.9
7 years ago
1.0.8
7 years ago
1.0.7
7 years ago
1.0.6
7 years ago
1.0.5
7 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago