We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent dc802b0 commit 0cfd540Copy full SHA for 0cfd540
2 files changed
src/bee.ts
@@ -1384,6 +1384,10 @@ export class Bee {
1384
ws.onopen = () => {
1385
startPing()
1386
flushQueue()
1387
+
1388
+ if (handler.onOpen) {
1389
+ handler.onOpen(subscription)
1390
+ }
1391
}
1392
1393
ws.onmessage = event => {
src/types/index.ts
@@ -418,6 +418,7 @@ export interface PubsubSubscription {
418
419
420
export interface PubsubMessageHandler {
421
+ onOpen?: (subscription: PubsubSubscription) => void
422
onMessage: (message: Bytes, subscription: PubsubSubscription) => void
423
onError: (error: BeeError, subscription: PubsubSubscription) => void
424
onClose: (subscription: PubsubSubscription) => void
0 commit comments