Skip to content

Commit ecd6783

Browse files
committed
Use the generic parameter directly
1 parent f466059 commit ecd6783

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: src/horizon/call_builder.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ 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 extends ServerApi.CollectionPage ? T["records"][number] : T> = {}): () => void {
105+
public stream(options: EventSourceOptions<
106+
T extends ServerApi.CollectionPage<infer U> ? U : T
107+
> = {}): () => void {
106108
// Check if EventSource use is enabled
107109
if (EventSource === undefined){
108110
throw new Error("Streaming requires eventsource to be enabled. If you need this functionality, compile with USE_EVENTSOURCE=true.");

0 commit comments

Comments
 (0)