Skip to content

Commit c742cd9

Browse files
committed
fix: support old constructor
1 parent bc0f373 commit c742cd9

3 files changed

Lines changed: 3 additions & 2 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
**/*.log
33
test/repo-tests*
44
**/bundle.js
5+
docs
56

67
# Logs
78
logs

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ const Room = require('ipfs-pubsub-room')
3636
const IPFS = require('ipfs')
3737

3838
const ipfs = await IPFS.create({ ... })
39-
const room = Room(ipfs.libp2p, 'room-name')
39+
const room = Room(ipfs, 'room-name')
4040
```
4141

4242
Once we have a room we can listen for messages

src/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ let index = 0
1818
class PubSubRoom extends EventEmitter {
1919
constructor (libp2p, topic, options) {
2020
super()
21-
this._libp2p = libp2p
21+
this._libp2p = libp2p.libp2p || libp2p
2222
this._topic = topic
2323
this._options = Object.assign({}, clone(DEFAULT_OPTIONS), clone(options))
2424
this._peers = []

0 commit comments

Comments
 (0)