Helper function to create Redux modules using the ducks-modular-redux proposal.
import { createDuck } from 'redux-duck'; const myDuck = createDuck('duck-name', 'application-name');
createDuck
receive 2 arguments, the second argument is optional.const ACTION_TYPE = myDuck.defineType('ACTION_TYPE');
defineType
receive just one argument.application-name/duck-name/ACTION_TYPE
or duck-name/ACTION_TYPE
if the application or module name was not defined.const actionType = myDuck.createAction(ACTION_TYPE);
createAction
receive just one argument.const initialState = { list: Immutable.List(), data: Immutable.Map(), }; const reducer = myDuck.createReducer({ [ACTION_TYPE]: (state, action) => ({ ...state, list: state.list.push(action.payload.id), data: state.map.set(action.payload.id+'', action.payload), }), }, initialState);
createReducer
receive two arguments, both required.RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4