diff --git a/src/services/stream.ts b/src/services/stream.ts index 3c5ef36399..c21ccb4a74 100644 --- a/src/services/stream.ts +++ b/src/services/stream.ts @@ -39,7 +39,7 @@ class Publisher { })); } - public publishInternalEvent = (type: K, value: InternalStreamTypes[K]): void => { + public publishInternalEvent = (type: K, value?: InternalStreamTypes[K]): void => { this.publish('internal', type, typeof value === 'undefined' ? null : value); } @@ -47,7 +47,7 @@ class Publisher { this.publish(`user:${userId}`, type, typeof value === 'undefined' ? null : value); } - public publishBroadcastStream = (type: K, value: BroadcastTypes[K]): void => { + public publishBroadcastStream = (type: K, value?: BroadcastTypes[K]): void => { this.publish('broadcast', type, typeof value === 'undefined' ? null : value); } @@ -59,7 +59,7 @@ class Publisher { this.publish(`driveStream:${userId}`, type, typeof value === 'undefined' ? null : value); } - public publishNoteStream = (noteId: Note['id'], type: K, value: NoteStreamTypes[K]): void => { + public publishNoteStream = (noteId: Note['id'], type: K, value?: NoteStreamTypes[K]): void => { this.publish(`noteStream:${noteId}`, type, { id: noteId, body: value