Skip to content

fr33z3/redux-contrib

Repository files navigation

Installation

$ npm install redux-contrib --save

USAGE

  import { createAction, createReducer } from 'redux-contrib';

  const createUserAction = createAction('CREATE_USER_ACTION', ['email', 'name']);

  const initialState = { user: undefined };
  const reducer = createReducer([
    [
      createUserAction,
      (_state, payload, _action) => ({ user: { email: payload.email, name: payload.name } }),
    ],
  ], initialState)

  const action = createUserAction({ email: '[email protected]', name: 'John Doe' });
  reducer(initialState, action);

About

Package to simplify redux boilerplate

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published