flive-app-redux-helpers
v0.1.5
Published
/!\ WIP /!\
Downloads
6
Keywords
Readme
flive-app-redux-helpers
/!\ WIP /!\
reduxApiFactory
TL;DR
import { reduxApiFactory } from 'filve-app-redux-helpers';
import { combineReducers } from 'redux';
const FETCH_FOO = '@@foo/FETCH_FOO';
const UPDATE_FOO = '@@foo/UPDATE_FOO';
const { actionCreator: getFooAction, reducer: fooReducer } = reduxApiFactory({
type: FETCH_FOO,
request: (client, params) => client.get('/foo', params)
})
const { actionCreator: updateFooAction, reducer: updateFooReducer = reduxApiFactory({
type: UPDATE_FOO,
request: (client, params) => client.put('/foo', params),
dataToRedux: false
})}
const reducers