Skip to content

Commit

Permalink
Add warning message even if there is no onmessage handler
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaptic committed Jan 3, 2024
1 parent 6378aae commit 06699dd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/horizon/call_builder.ts
Expand Up @@ -121,6 +121,13 @@ export class CallBuilder<

let createEventSource = (): EventSource => {
try {
if (!EventSource) {
console.warn(
'⚠️ No EventSource provider found: there is no streaming support ' +
'unless you polyfill it (e.g. `npm i eventsource`).'
);
}

es = new EventSource(this.url.toString());
} catch (err) {
if (options.onerror) {
Expand Down

0 comments on commit 06699dd

Please sign in to comment.