Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 5c7df41

Browse files
committed
docs: add note about unsubscription
1 parent db9fdaf commit 5c7df41

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

API/pubsub/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ pubsub API
1515

1616
`callback` must follow `function (err, subscription) {}` where Subscription is a Node.js Stream in Object mode, emiting a `data` event for each new message on the subscribed topic.`err` is an error if the operation was not successful.
1717

18+
`subscription` has a `.cancel` event in order to cancel the subscription.
19+
1820
If no `callback` is passed, a [promise][] is returned.
1921

2022
> _In the future, topic can also be type of TopicDescriptor (https://github.com/libp2p/pubsub-notes/blob/master/flooding/flooding.proto#L23). However, for now, only strings are supported._

0 commit comments

Comments
 (0)