11online-redux-helpers

1.0.2 • Public • Published

11online Redux Helpers

Some helpful helper functions from merging state and deleting from state.

Current version only uses id.

Import like so: import {mergeState, deleteFromState} from '11online-redux-helpers';

Use like so in your reducer:

case POST_ACTIVITY_SUCCESS:
	return {
	    ...state,
	    isFetching: false,
	    error: [],
	    activities: mergeState(state.activities, action.payload)
	};

or

case DELETE_ACTIVITY_SUCCESS:
    return {
        ...state,
        isFetching: false,
        error: [],
        activities: deleteFromState(state.activities, action.payload)
    };

Readme

Keywords

Package Sidebar

Install

npm i 11online-redux-helpers

Weekly Downloads

0

Version

1.0.2

License

MIT

Last publish

Collaborators

  • ericdebelak