HIGHER-ORDER FETCH
Using window.fetch()
with some handful composable logic.
Why you need this
See my article here.
tldr;
This library provides a set of handful fetch
enhancement as well as gives you the idea to create a fetch
method that:
- Fetch data from server, of course
- Enhanced but remained the familiarity of the Fetch API that documented and provided by the browsers, so that everyone can quickly understand and use it.
- The enhancement can be easily managed, opt in or out depend on the need of your project.
Installation
npm install higher-order-fetch
or
yarn add higher-order-fetch
How to use
Step 1: Compose your fetch:
// fetchHelper.js;;;; const fetchHelper = fetch: windowfetch;;
Step 2: Use it
// somewhere-that-need-to-fetch-data.js; fetchHelper;
Example
Checkout the example for a recommended fetch setup and usage
API
https://rudyhuynh.github.io/higher-order-fetch/identifiers.html
LISCENE
MIT