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 5e60de0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 5e60de0

Please sign in to comment.