aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 504782894cddfb25461e8c323581262c10a4838b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
## sdc-pubsub

sdc-pubsub [npm](https://www.npmjs.com/package/sdc-pubsub) package.

### Installation

Installing using npm:

```
npm install sdc-pubsub
```

### Loading It Up
#### ES6
```javascript
import {PluginPubSub} from 'sdc-pubsub'
```
#### ES5

```javascript
var pluginPubSub = require('PluginPubSub')
```

### Usage
#### Initialize a pubsub client
```javascript
//eventsClientId=<received from query params>
//parentUrl=<received from query params>
//eventsToWaitFor = [ “CHECK_IN” ]

var client = new PluginPubSub('eventsClientId, parentUrl, eventsToWaitFor')
```

#### Notify about events
```javascript
client.notify(READY)
```

#### Register for an event
```javascript
client.on((eventData,event) => {
      if(eventData.type == WINDOW_OUT) {
		             //do logic
       }
   }
)
```

### Dependencies

* None.

### Tests

None.

### Authors

* Idan Amit: [https://wiki.onap.org/display/~idanamit](hhttps://wiki.onap.org/display/~idanamit)


### Links

sdc onap wiki [https://wiki.onap.org/x/_TX0](https://wiki.onap.org/x/_TX0)

### License

Copyright 2018 AT&T, Inc.

Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0