Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sctructuring store, actions and reducers #2

Open
lostm1nd opened this issue Apr 20, 2016 · 0 comments
Open

Sctructuring store, actions and reducers #2

lostm1nd opened this issue Apr 20, 2016 · 0 comments
Assignees

Comments

@lostm1nd
Copy link
Member

var people = [add, remove];
var aliens = [add, remove];

var addPerson = function (name, age) {
  return {
    type: 'people:add',
    name: name,
    age: age
  };
};

var app = function (state, action) {
  var reducer = action.type.split(':').shift();
  reducer(state, action.type.split(':').pop());
}
@lostm1nd lostm1nd self-assigned this Apr 20, 2016
@lostm1nd lostm1nd changed the title Sctructuring reducers Sctructuring store, actions and reducers Apr 20, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant