fetch wrapper class (universal)
- isomorphic-unfetch
- typescript
$ npm i
$ npm run watch
// on client
const fetcher = new Fetcher('https://exmaple.com');
// use Fetcher
const getOption = {
header: {
'Content-Type': 'application/json'
},
mode: 'cors'
};
fetcher
.get('user', getOption)
.then(res => res.json())
.then(res => console.log(res));