Skip to content

Commit d522036

Browse files
MarkHerholdTimothyGu
authored andcommitted
Bind fetch to window in the browser (node-fetch#434)
1 parent a1cbcb5 commit d522036

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

browser.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = exports = window.fetch;
22

3-
// Needed for TypeScript.
4-
exports.default = window.fetch;
3+
// Needed for TypeScript and Webpack.
4+
exports.default = window.fetch.bind(window);
55

66
exports.Headers = window.Headers;
77
exports.Request = window.Request;

0 commit comments

Comments
 (0)