jfetch
jfetch is a small library that makes it easier to use the fetch library. Use it if you have an all json communication with your rest endpoint
Install
npm install --save jfetch
Usage
//es6 modules; //amdconst jfetch = ;//amd altconst jfetch = default;
Quick Usage
//standard get //process json here is a function ; //postjfetch ;
Customizing Jfetch
You can use jfetch such that you are able to change the behavior on how each of the requests behaves. This is done using the createJfetch function.
; //es6 modules //const { createJfetch } = require('jfetch'); //amd const jfetch = ; ; //...will not auto bust get
Settings for custom jfetch
- withConfig - function that returns an extra configuration to be merged with the requests
- onRespose - function that can receive response data