"Fossies" - the Fresh Open Source Software Archive

Member "jitsi-meet-7319/react/features/noise-suppression/reducer.ts" (6 Jun 2023, 679 Bytes) of package /linux/misc/jitsi-meet-7319.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) TypeScript source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

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