react-fetch-epic-builder
An utilitary lib for build "fetch actions" and generic EPICs handled by redux-observable.
Follow an example of use based on ducks structure.
;; const buildEpic = ; // action typesconst GET_COMMENTS = 'posts/GET_COMMENTS';const GET_COMMENTS_SUCCESS = ;const GET_COMMENTS_ERROR = ; const actionsType = GET_COMMENTS GET_COMMENTS_SUCCESS GET_COMMENTS_ERROR // reducer example { return state;} //action creators // get comments from a postconst getComments = type: GET_COMMENTS // (required) action type host: 'http://myblog.com' // (optional, if a default was configured) path: `/posts//comments` // (optional) destination path query: // (optional) query parameter object page const actionCreators = getComments // epicsconst epics = ;
posts.js
;; const rootEpic = ; ;
epics/index.js