Skip to content

Commit 1cb0504

Browse files
committed
fix: bind custom fetch to globalThis
fixes #14 Signed-off-by: Lukas Reining <lukas.reining@codecentric.de>
1 parent 4823535 commit 1cb0504

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "extended-eventsource",
3-
"version": "1.5.1",
3+
"version": "1.5.2",
44
"author": "Lukas Reining",
55
"readme": "README.md",
66
"description": "Spec compliant EventSource implementation for browsers and Node.JS",

src/eventsource.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export class CustomEventSource extends EventTarget implements EventSource {
4545
constructor(
4646
url: string | URL,
4747
initDict?: EventSourceInit & EventSourceOptions,
48-
{ inputFetch } = { inputFetch: globalThis.fetch },
48+
{ inputFetch } = { inputFetch: globalThis.fetch.bind(globalThis) },
4949
) {
5050
super();
5151
this.fetch = inputFetch;

0 commit comments

Comments
 (0)