/PoC_Fetcher

Primary LanguageTypeScript

Fetcher

fetch wrapper class (universal)

Spec

Development

$ npm i
$ npm run watch

Usage

// 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));