Skip to content
This repository was archived by the owner on Jun 27, 2023. It is now read-only.

Commit afd1049

Browse files
committed
chore: address review
1 parent 5b4f41b commit afd1049

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ TODO: add explanation for registrar!
5050
const Pubsub = require('libp2p-pubsub')
5151

5252
class PubsubImplementation extends Pubsub {
53-
constructor(peerInfo, registrar, options = {}) {
53+
constructor({ peerInfo, registrar, ...options })
5454
super({
5555
debugName: 'libp2p:pubsub',
5656
multicodecs: '/pubsub-implementation/1.0.0',
@@ -90,7 +90,7 @@ The following specified API should be the base API for a pubsub implementation o
9090

9191
### Start
9292

93-
Start the pubsub subsystem. The protocol will be registered to `libp2p`, which will notify about peers being connected and disconnected with the protocol.
93+
Starts the pubsub subsystem. The protocol will be registered to `libp2p`, which will result in pubsub being notified when peers who support the protocol connect/disconnect to `libp2p`.
9494

9595
#### `pubsub.start()`
9696

@@ -102,7 +102,7 @@ Start the pubsub subsystem. The protocol will be registered to `libp2p`, which w
102102

103103
### Stop
104104

105-
Stop the pubsub subsystem. The protocol will be unregistered to `libp2p`, which will remove all listeners for the protocol and the streams with other peers will be closed.
105+
Stops the pubsub subsystem. The protocol will be unregistered from `libp2p`, which will remove all listeners for the protocol and the established connections will be closed.
106106

107107
#### `pubsub.stop()`
108108

@@ -169,7 +169,7 @@ Get the list of topics which the peer is subscribed to.
169169

170170
### Get Peers Subscribed to a topic
171171

172-
Get a list of the peer-ids that are subscribed to one topic.
172+
Get a list of the [PeerId](https://github.com/libp2p/js-peer-id) strings that are subscribed to one topic.
173173

174174
#### `pubsub.getPeersSubscribed(topic)`
175175

test/pubsub.spec.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ describe('pubsub base protocol', () => {
5353
expect(sinonMockRegistrar.unregister.calledOnce).to.be.true()
5454
})
5555

56-
it('should not throw to start if already started', async () => {
56+
it('starting should not throw if already started', async () => {
5757
await pubsub.start()
5858
await pubsub.start()
5959
expect(sinonMockRegistrar.handle.calledOnce).to.be.true()
@@ -63,14 +63,14 @@ describe('pubsub base protocol', () => {
6363
expect(sinonMockRegistrar.unregister.calledOnce).to.be.true()
6464
})
6565

66-
it('should not throw if stop before start', async () => {
66+
it('stopping should not throw if not started', async () => {
6767
await pubsub.stop()
6868
expect(sinonMockRegistrar.register.calledOnce).to.be.false()
6969
expect(sinonMockRegistrar.unregister.calledOnce).to.be.false()
7070
})
7171
})
7272

73-
describe('should handle messages creating and signing', () => {
73+
describe('should handle message creation and signing', () => {
7474
let peerInfo
7575
let pubsub
7676

0 commit comments

Comments
 (0)