[ABANDONED] React/Redux front end for the Flexor social network.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
717 B

5 years ago
  1. import { Reducer } from 'redux'
  2. import { ComposerActions } from '../actions/composer'
  3. import { ComposerState } from '../types'
  4. const initialState: ComposerState = {
  5. installations: [],
  6. selected: undefined,
  7. }
  8. const reducer: Reducer<ComposerState, ComposerActions> = (state = initialState, action) => {
  9. switch (action.type) {
  10. case 'COMPOSER_SET_INSTALLATIONS':
  11. return {
  12. ...state,
  13. installations: action.payload,
  14. }
  15. case 'COMPOSER_SET_SELECTED_INSTALLATION':
  16. return {
  17. ...state,
  18. selected: action.payload,
  19. }
  20. default:
  21. return state
  22. }
  23. }
  24. export default reducer