Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

reducer.js 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. import { ReducerRegistry } from '../base/redux';
  2. import {
  3. PARTICIPANTS_PANE_CLOSE,
  4. PARTICIPANTS_PANE_OPEN,
  5. SET_VOLUME
  6. } from './actionTypes';
  7. import { REDUCER_KEY } from './constants';
  8. const DEFAULT_STATE = {
  9. isOpen: false,
  10. participantsVolume: {}
  11. };
  12. /**
  13. * Listen for actions that mutate the participants pane state
  14. */
  15. ReducerRegistry.register(
  16. REDUCER_KEY, (state = DEFAULT_STATE, action) => {
  17. switch (action.type) {
  18. case PARTICIPANTS_PANE_CLOSE:
  19. return {
  20. ...state,
  21. isOpen: false
  22. };
  23. case PARTICIPANTS_PANE_OPEN:
  24. return {
  25. ...state,
  26. isOpen: true
  27. };
  28. case SET_VOLUME:
  29. return {
  30. ...state,
  31. participantsVolume: {
  32. ...state.participantsVolume,
  33. [action.participantId]: action.volume
  34. }
  35. };
  36. default:
  37. return state;
  38. }
  39. },
  40. );