Skip to content

Commit

Permalink
expose pubnub as part of the api
Browse files Browse the repository at this point in the history
  • Loading branch information
ianjennings committed Jan 6, 2017
1 parent c8688e3 commit 8eb301b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions guides/pubnub.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,5 @@ let client = rltm({
```

You can read about more config options on the official [PubNub Documentation](https://www.pubnub.com/docs/javascript/api-reference-sdk-v4#init).

This service exposes PubNub only features within ```client.pubnub``` or ```room.pubnub```.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rltm",
"version": "1.0.3",
"version": "1.0.4",
"description": "abstraction for realtime frameworks",
"main": "src/index.js",
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions src/services/pubnub.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,11 +270,11 @@ module.exports = function(setup) {
this.service = setup.service;

// initialize PubNub with supplied config information
let pubnub = new PubNub(setup.config);
this.pubnub = new PubNub(setup.config);

// expose the join method to create new room connections
this.join = (channel, state) => {
return new Room(pubnub, channel, setup.config.uuid, state);
return new Room(this.pubnub, channel, setup.config.uuid, state);
}

// return the instance of this service
Expand Down

0 comments on commit 8eb301b

Please sign in to comment.