Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit b918b3d

Browse files
committed
Update resend/subscribe signature so onMessage is optional.
1 parent b084961 commit b918b3d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/StreamrClient.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ export default class StreamrClient extends EventEmitter {
337337
return this.publisher.rotateGroupKey(...args)
338338
}
339339

340-
async subscribe(opts: Todo, onMessage: OnMessageCallback) {
340+
async subscribe(opts: Todo, onMessage?: OnMessageCallback) {
341341
let subTask: Todo
342342
let sub: Todo
343343
const hasResend = !!(opts.resend || opts.from || opts.to || opts.last)
@@ -372,7 +372,7 @@ export default class StreamrClient extends EventEmitter {
372372
await this.subscriber.unsubscribe(opts)
373373
}
374374

375-
async resend(opts: Todo, onMessage: OnMessageCallback) {
375+
async resend(opts: Todo, onMessage?: OnMessageCallback) {
376376
const task = this.subscriber.resend(opts)
377377
if (typeof onMessage !== 'function') {
378378
return task

0 commit comments

Comments
 (0)