From ede6f24bea465c717dce213f33ddf785808e3a5c Mon Sep 17 00:00:00 2001 From: Alex Rubner Date: Mon, 19 Oct 2020 12:42:39 +0100 Subject: [PATCH] Bind fetch to window Solution to #230 --- src/fetch.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetch.ts b/src/fetch.ts index d4643128..9666179a 100644 --- a/src/fetch.ts +++ b/src/fetch.ts @@ -2,5 +2,5 @@ import nodeFetch from 'node-fetch'; export = ( // istanbul ignore next - typeof window === 'undefined' ? (nodeFetch as typeof fetch) : fetch + typeof window === 'undefined' ? (nodeFetch as typeof fetch) : window.fetch.bind(window)) );