Skip to content

Commit

Permalink
Use the generic parameter directly
Browse files Browse the repository at this point in the history
  • Loading branch information
challet authored Nov 13, 2024
1 parent f466059 commit c5eb1cc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/horizon/call_builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export class CallBuilder<
* @param {number} [options.reconnectTimeout] Custom stream connection timeout in ms, default is 15 seconds.
* @returns {Function} Close function. Run to close the connection and stop listening for new events.
*/
public stream(options: EventSourceOptions<T extends ServerApi.CollectionPage ? T["records"][number] : T> = {}): () => void {
public stream(options: EventSourceOptions<T extends ServerApi.CollectionPage<infer U> ? U : T> = {}): () => void {
// Check if EventSource use is enabled
if (EventSource === undefined){
throw new Error("Streaming requires eventsource to be enabled. If you need this functionality, compile with USE_EVENTSOURCE=true.");
Expand Down Expand Up @@ -428,4 +428,4 @@ export class CallBuilder<
return Promise.reject(new Error(error.message));
}
}
}
}

0 comments on commit c5eb1cc

Please sign in to comment.