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.

reducer.js 691B

12345678910111213141516171819202122232425262728
  1. // @flow
  2. import { equals, set, ReducerRegistry } from '../../base/redux';
  3. import { _SET_AUDIOMODE_DEVICES, _SET_AUDIOMODE_SUBSCRIPTIONS } from './actionTypes';
  4. const DEFAULT_STATE = {
  5. devices: [],
  6. subscriptions: []
  7. };
  8. ReducerRegistry.register('features/mobile/audio-mode', (state = DEFAULT_STATE, action) => {
  9. switch (action.type) {
  10. case _SET_AUDIOMODE_DEVICES: {
  11. const { devices } = action;
  12. if (equals(state.devices, devices)) {
  13. return state;
  14. }
  15. return set(state, 'devices', devices);
  16. }
  17. case _SET_AUDIOMODE_SUBSCRIPTIONS:
  18. return set(state, 'subscriptions', action.subscriptions);
  19. }
  20. return state;
  21. });