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 <[email protected]>
  • Loading branch information
lukas-reining committed Sep 6, 2024
1 parent 4823535 commit 1cb0504
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 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 package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "extended-eventsource",
"version": "1.5.1",
"version": "1.5.2",
"author": "Lukas Reining",
"readme": "README.md",
"description": "Spec compliant EventSource implementation for browsers and Node.JS",
Expand Down
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 1cb0504

Please sign in to comment.