Skip to content

Commit f466059

Browse files
committed
stream messages are actually items of a collection
1 parent 40d1497 commit f466059

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/horizon/call_builder.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class CallBuilder<
102102
* @param {number} [options.reconnectTimeout] Custom stream connection timeout in ms, default is 15 seconds.
103103
* @returns {Function} Close function. Run to close the connection and stop listening for new events.
104104
*/
105-
public stream(options: EventSourceOptions<T> = {}): () => void {
105+
public stream(options: EventSourceOptions<T extends ServerApi.CollectionPage ? T["records"][number] : T> = {}): () => void {
106106
// Check if EventSource use is enabled
107107
if (EventSource === undefined){
108108
throw new Error("Streaming requires eventsource to be enabled. If you need this functionality, compile with USE_EVENTSOURCE=true.");

0 commit comments

Comments
 (0)