1.0.2 • Published 9 years ago

reflux-create-reducer v1.0.2

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

reflux-create-reducer

This code packaged as a node module

Usage:

import { createReducer } from 'reflux-create-reducer';
import * as ActionTypes from '../constants/ActionTypes';

const initialState = [];


export const todos = createReducer(initialState, {
  [ActionTypes.ADD_TODO](state, action) {
    let text = action.text.trim();
    return [...state, text];
  }
})