0.0.4 • Published 5 years ago

redux-contrib v0.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
5 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

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago