dux-fetch
v1.2.0
Published
> Yet another redux fetch middleware
Downloads
2
Readme
dux-fetch
Yet another redux fetch middleware
Dux
How To Use ?
First, you should place all your dux component in path /dux
.
A dux-fetch
component look like this:
// users.js
// Actions
const FETCH_READ_USER = 'my-app/user/read';
// Reducer
const initState = {};
const reducer = handleActions({
[FETCH_READ_USER]: (state, action) => ({}),
});
export default reducer;
// Action Creators
export const readUser = (id) => createFetchAction(
FETCH_READ_USER,
() => fetch(`/user/${id}/`)
);