UNPKG

@scripty/react-store

Version:

This lightweight global react hook store is inspired by the extjs store architecture. Share your stores through your application with only a few lines of code!

21 lines (17 loc) 404 B
import axios from 'axios'; export const request = async (method, url, data = {}) => { let params = { method: method, url: url, data: data }; if (method === 'get') { params = { method: method, url: url, params: data }; } let response = await axios(params); return response.data; };