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

Readme

Keywords

none

Package Sidebar

Install

npm i flive-app-redux-helpers

Weekly Downloads

1

Version

0.1.5

License

MIT

Unpacked Size

7.4 kB

Total Files

5

Last publish

Collaborators

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