Skip to content

Commit

Permalink
fix: bind custom fetch to globalThis
Browse files Browse the repository at this point in the history
fixes #14

Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
  • Loading branch information
lukas-reining committed Sep 6, 2024
1 parent 4823535 commit b2d801a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/eventsource.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export class CustomEventSource extends EventTarget implements EventSource {
constructor(
url: string | URL,
initDict?: EventSourceInit & EventSourceOptions,
{ inputFetch } = { inputFetch: globalThis.fetch },
{ inputFetch } = { inputFetch: globalThis.fetch.bind(globalThis) },
) {
super();
this.fetch = inputFetch;
Expand Down

0 comments on commit b2d801a

Please sign in to comment.