mirror of
https://github.com/logos-messaging/docs.waku.org.git
synced 2026-01-02 12:53:12 +00:00
Merge branch 'develop' into add-community-links
This commit is contained in:
commit
711a11d9ff
@ -129,7 +129,12 @@ const callback = (wakuMessage) => {
|
||||
};
|
||||
|
||||
// Create a Filter subscription
|
||||
const subscription = await node.filter.createSubscription();
|
||||
const { error, subscription } = await node.filter.createSubscription({ contentTopics: [contentTopic] });
|
||||
|
||||
if (error) {
|
||||
// handle errors if happens
|
||||
throw Error(error);
|
||||
}
|
||||
|
||||
// Subscribe to content topics and process new messages
|
||||
await subscription.subscribe([decoder], callback);
|
||||
|
||||
@ -21,7 +21,12 @@ The `@waku/sdk` package provides a `Filter.ping()` function to ping subscription
|
||||
|
||||
```js
|
||||
// Create a Filter subscription
|
||||
const subscription = await node.filter.createSubscription();
|
||||
const { error, subscription } = await node.filter.createSubscription({ contentTopics: [contentTopic] });
|
||||
|
||||
if (error) {
|
||||
// handle errors if happens
|
||||
throw Error(error);
|
||||
}
|
||||
|
||||
// Subscribe to content topics and process new messages
|
||||
await subscription.subscribe([decoder], callback);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user