0.0.4 • Published 6 years ago

redux-contrib v0.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
6 years ago

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: 'some@email.com', name: 'John Doe' });
  reducer(initialState, action);
0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago