您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. });