💰 Axios plugin that uses store.js to cache GET requests.
Currently only availble via GitHub:
npm install usePF/axios-store-plugin
import axios from 'axios';
import storePlugin from 'axios-store-plugin';
const baseURL = `https://myapi.com/`;
const api = storePlugin(axios.create({ baseURL }));
// Use it like you would use Axios normally
const getNotifications = () => api.get('/notifications');
How to use and love the the axios store plugin.
axiosStore(axiosInstance: axios)
The axiosStore funtion only accepts one argument, an instace of Axios.
Becuase the plugin only stores the data
portion of the axios response, for consistency the data
portion is always unwrapped and returned.