Skip to content

Commit

Permalink
fix: support old constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
achingbrain committed Jan 28, 2020
1 parent bc0f373 commit c742cd9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
**/*.log
test/repo-tests*
**/bundle.js
docs

# Logs
logs
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Room = require('ipfs-pubsub-room')
const IPFS = require('ipfs')

const ipfs = await IPFS.create({ ... })
const room = Room(ipfs.libp2p, 'room-name')
const room = Room(ipfs, 'room-name')
```

Once we have a room we can listen for messages
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ let index = 0
class PubSubRoom extends EventEmitter {
constructor (libp2p, topic, options) {
super()
this._libp2p = libp2p
this._libp2p = libp2p.libp2p || libp2p
this._topic = topic
this._options = Object.assign({}, clone(DEFAULT_OPTIONS), clone(options))
this._peers = []
Expand Down

0 comments on commit c742cd9

Please sign in to comment.