refetch
refetch let you simply add timeout
and retry
method to your fetch API

Install
npm install re-fetch --save
Usage
The url
and options
are totally same as fetch.
; //timeout is milliseconds like: 3000 ;
timeout
: milliseconds, default is 5000retryTimes
: try times, default is 1cb
: callback will fired each timeout, has one parameter - number of try times left
Example in the GIF
; // the server will response the 4th time. ;