Skip to content

Commit

Permalink
Bind fetch to window (#235)
Browse files Browse the repository at this point in the history
Solution to #230

Co-authored-by: Alex Rubner <alex.rubner@gmail.com>
  • Loading branch information
mzgoddard and rub1e committed Nov 2, 2020
1 parent 96e2e80 commit c86672f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build/airtable.browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
var node_fetch_1 = __importDefault(require("node-fetch"));
module.exports = (
// istanbul ignore next
typeof window === 'undefined' ? node_fetch_1.default : fetch);
typeof window === 'undefined' ? node_fetch_1.default : window.fetch.bind(window));

},{"node-fetch":20}],8:[function(require,module,exports){
"use strict";
Expand Down
2 changes: 1 addition & 1 deletion src/fetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
);

0 comments on commit c86672f

Please sign in to comment.