We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 40d1497 commit f466059Copy full SHA for f466059
src/horizon/call_builder.ts
@@ -102,7 +102,7 @@ export class CallBuilder<
102
* @param {number} [options.reconnectTimeout] Custom stream connection timeout in ms, default is 15 seconds.
103
* @returns {Function} Close function. Run to close the connection and stop listening for new events.
104
*/
105
- public stream(options: EventSourceOptions<T> = {}): () => void {
+ public stream(options: EventSourceOptions<T extends ServerApi.CollectionPage ? T["records"][number] : T> = {}): () => void {
106
// Check if EventSource use is enabled
107
if (EventSource === undefined){
108
throw new Error("Streaming requires eventsource to be enabled. If you need this functionality, compile with USE_EVENTSOURCE=true.");
0 commit comments