Client Cache Fetch
Helper for fetching and caching text responses using localStorage
.
Installation
npm install client-cache-fetch
Syntax
Client cache fetch inherits the same API as fetch()
.
cacheFetchResponsePromise = cacheFetch(resource, init);
Example
import cacheFetch from "client-cache-fetch";
const reponse = await cacheFetch("https://api.ipdata.co/?api-key=test", {
method: "GET",
headers: {
"Content-Type": "text/json",
},
});