store.js 644 B

123456789101112131415161718192021222324252627
  1. /**
  2. * React Static Boilerplate
  3. * https://github.com/koistya/react-static-boilerplate
  4. *
  5. * Copyright © 2015-2016 Konstantin Tarkus (@koistya)
  6. *
  7. * This source code is licensed under the MIT license found in the
  8. * LICENSE.txt file in the root directory of this source tree.
  9. */
  10. import { createStore } from 'redux';
  11. /**
  12. * Centralized application state
  13. * See http://redux.js.org/
  14. */
  15. const store = createStore((state, action) => {
  16. // TODO: Add action handlers (aka "reduces")
  17. switch (action) {
  18. case 'COUNT':
  19. return { ...state, count: (state.count || 0) + 1 };
  20. default:
  21. return state;
  22. }
  23. });
  24. export default store;