jakesidsmith / comquest Goto Github PK
View Code? Open in Web Editor NEWComposable requests with redux thunk and axios
Home Page: https://www.npmjs.com/package/comquest
License: MIT License
Composable requests with redux thunk and axios
Home Page: https://www.npmjs.com/package/comquest
License: MIT License
Add examples that mock axios requests so users can manually skip forward or back, through requests / actions
Handle dispatching clear data, clear error and reset request state based on options provided to a request
Allow supplying an object, keyed with action types, with handlers as values
This way, for example, a reducer for a list of users can also listen to actions for a specific user to update items in the list
Handle cancelling requests by dispatching a cancel action
const user = createComquestEndpoint('USER', {url: '/api/user/:id/'}, {});
Returns an object containing:
interface ComquestEndpoint<D = AxiosResponse, E = AxiosError> {
actionTypes: ComquestActionTypes;
post: ComquestActionCreator;
put: ComquestActionCreator;
patch: ComquestActionCreator;
get: ComquestActionCreator;
delete: ComquestActionCreator;
options: ComquestActionCreator;
clearRequestData: () => ComquestAction;
clearRequestErrors: () => ComquestAction;
resetRequestState: () => ComquestAction;
reducer: (state: ComquestRequestState & ComquestRequestData<D> & ComquestRequestError<E> = {}, action: AnyAction) => ComquestRequestState & ComquestRequestData<D> & ComquestRequestError<E>;
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.