File size: 528 Bytes
f2bee8a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
const UPDATE = 'scratch-gui/mic-indicator/UPDATE';

const initialState = false;

const reducer = function (state, action) {
    if (typeof state === 'undefined') state = initialState;
    switch (action.type) {
    case UPDATE:
        return action.visible;
    default:
        return state;
    }
};

const updateMicIndicator = function (visible) {
    return {
        type: UPDATE,
        visible: visible
    };
};

export {
    reducer as default,
    initialState as micIndicatorInitialState,
    updateMicIndicator
};