state.js 709 B

1234567891011121314151617181920212223242526272829
  1. /** @module match/state */
  2. /**
  3. * state.js
  4. *
  5. * Collection of everything which has to do with state changes.
  6. **/
  7. /** actionTypes define what actions are handeled by the reducer. */
  8. export const actions = {
  9. setState: matches => {
  10. type: 'SET_MATCHES',
  11. matches
  12. }
  13. }
  14. console.log('State actions', actions)
  15. /** state definition */
  16. export const state = {}
  17. console.log('State state', state)
  18. /** reducer is called by the redux dispatcher and handles all component actions */
  19. export function reducer (state = [], action) {
  20. let nextState = state
  21. return nextState
  22. }
  23. /** sagas are asynchronous workers (JS generators) to handle the state. */
  24. export function * saga () {}