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

reducer.ts 823B

123456789101112131415161718192021222324252627282930313233343536
  1. import PersistenceRegistry from '../base/redux/PersistenceRegistry';
  2. import ReducerRegistry from '../base/redux/ReducerRegistry';
  3. import {
  4. SET_NOISE_SUPPRESSION_ENABLED
  5. } from './actionTypes';
  6. export interface INoiseSuppressionState {
  7. enabled: boolean;
  8. }
  9. const STORE_NAME = 'features/noise-suppression';
  10. const DEFAULT_STATE = {
  11. enabled: false
  12. };
  13. PersistenceRegistry.register(STORE_NAME);
  14. /**
  15. * Reduces the Redux actions of the feature features/noise-suppression.
  16. */
  17. ReducerRegistry.register<INoiseSuppressionState>(STORE_NAME,
  18. (state = DEFAULT_STATE, action): INoiseSuppressionState => {
  19. const { enabled } = action;
  20. switch (action.type) {
  21. case SET_NOISE_SUPPRESSION_ENABLED:
  22. return {
  23. ...state,
  24. enabled
  25. };
  26. default:
  27. return state;
  28. }
  29. });