Skip to content

Commit d3a9b77

Browse files
author
Lee Richmond
committed
Remove fetch polyfill dep
1 parent 66068b6 commit d3a9b77

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ Person.where({ name: 'Joe' }).page(2).per(10).sort('name').then((people) => {
3535
});
3636
```
3737

38+
### Fetch
39+
40+
Depending on your requirements, you may need a `fetch` polyfill for use
41+
in legacy browsers or NodeJS. There are a variety of polyfills and ways
42+
to install, so implementation is up to you. Here are two recommendations:
43+
44+
```js
45+
// node
46+
require('isomorphic-fetch')
47+
```
48+
49+
```js
50+
// browser
51+
import 'whatwg-fetch'
52+
```
53+
3854
### JSON Web Tokens
3955

4056
jsorm supports setting a JWT and using it for all requests. Set it

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"chai-as-promised": "^6.0.0",
2727
"chai-things": "^0.2.0",
2828
"fetch-mock": "^5.10.0",
29+
"isomorphic-fetch": "^2.2.1",
2930
"lodash.clonedeep": "^4.5.0",
3031
"lodash.snakecase": "^4.1.1",
3132
"mocha": "^3.2.0",
@@ -38,7 +39,6 @@
3839
},
3940
"dependencies": {
4041
"es6-promise": "^4.0.5",
41-
"isomorphic-fetch": "^2.2.1",
4242
"lodash-es": "^4.17.4"
4343
}
4444
}

src/main.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/// <reference path="./index.d.ts" />
22

3-
import 'es6-promise';
4-
import 'isomorphic-fetch';
3+
import * as es6Promise from 'es6-promise';
4+
es6Promise.polyfill();
55

66
import patchExtends from './custom-extend';
77
patchExtends();

0 commit comments

Comments
 (0)