flive-app-redux-helpers

0.1.5 • Public • Published

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

Dependents (0)

Package Sidebar

Install

npm i flive-app-redux-helpers

Weekly Downloads

3

Version

0.1.5

License

MIT

Unpacked Size

7.4 kB

Total Files

5

Last publish

Collaborators

  • robnriks
  • cgrimal
  • damien-s
  • lbdremy
  • feychenie-sigfox