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 committed Nov 13, 2024
1 parent f466059 commit 481798a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion 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

0 comments on commit 481798a

Please sign in to comment.