Skip to content

Instantly share code, notes, and snippets.

View Jetsly's full-sized avatar
🎯
Focusing

ddot Jetsly

🎯
Focusing
View GitHub Profile
// https://webpack.js.org/api/hot-module-replacement/
import {
dismissBuildError,
dismissRuntimeErrors,
reportBuildError,
reportRuntimeError,
startReportingRuntimeErrors,
stopReportingRuntimeErrors,
} from 'react-error-overlay';
declare type StatusType =
@Jetsly
Jetsly / unaxios.ts
Last active February 28, 2020 11:18
import { stringify } from 'qs';
import 'unfetch/polyfill';
const isJson = contentType =>
contentType && contentType.indexOf('application/json') > -1;
const defaultResponseHandle = {
fulfilled: res =>
Promise.resolve(
isJson(res.headers.get('content-type')) ? res.json() : res.text()