Sha256: bf3f0388bcce4db7f10b2837a1dfcec5fa54f0c2a451d4dbe5eed256c1223f56

Contents?: true

Size: 528 Bytes

Versions: 10

Compression:

Stored size: 528 Bytes

Contents

import Immutable from 'immutable';

import * as actionTypes from '../constants/helloWorldConstants';

export const $$initialState = Immutable.fromJS({
  name: '', // this is the default state that would be used if one were not passed into the store
});

export default function helloWorldReducer($$state = $$initialState, action) {
  const { type, name } = action;

  switch (type) {
    case actionTypes.HELLO_WORLD_NAME_UPDATE: {
      return $$state.set('name', name);
    }

    default: {
      return $$state;
    }
  }
}

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
react_on_rails-1.2.2 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
react_on_rails-1.2.1 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
react_on_rails-1.2.0 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
react_on_rails-1.2.0.rc1 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
react_on_rails-1.1.1 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
react_on_rails-1.1.0 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
react_on_rails-1.0.3 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
react_on_rails-1.0.2 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
react_on_rails-1.0.1 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx
react_on_rails-1.0.0 lib/generators/react_on_rails/templates/redux/base/client/app/bundles/HelloWorld/reducers/helloWorldReducer.jsx