Skip to content

Commit

Permalink
Merge pull request #4 from code-wallet/issue-3
Browse files Browse the repository at this point in the history
Fix for issue-3
  • Loading branch information
zfedoran authored Nov 8, 2023
2 parents 09b2d91 + 50608b2 commit 65ef6c0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/client/src/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ class Connection {
constructor(endpoint: string, fetch: Function = globalThis.fetch) {
// The Fetch API is supported experimentally in Node 17.5+ and natively in Node 18+.
this.endpoint = endpoint;
this.fetch = fetch;

// Ensure that the fetch function is called with the right context and
// doesn't trigger "Illegal invocation".
this.fetch = (...args: any) => fetch.apply(globalThis, args);
}

/**
Expand Down

0 comments on commit 65ef6c0

Please sign in to comment.