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