reducer.js in BeyondWords – AI audio for publishers 4.0.2, at src/Core/Settings/store/reducer.js
| 1 | /** |
| 2 | * Internal dependencies |
| 3 | */ |
| 4 | import { DEFAULT_STATE } from './'; |
| 5 | |
| 6 | const reducer = ( state = DEFAULT_STATE, action ) => { |
| 7 | switch ( action.type ) { |
| 8 | case 'SET_IS_REGENERATING_AUDIO': |
| 9 | return { |
| 10 | ...state, |
| 11 | isRegeneratingAudio: action.value, |
| 12 | }; |
| 13 | case 'SET_LANGUAGES': |
| 14 | return { |
| 15 | ...state, |
| 16 | languages: action.value, |
| 17 | }; |
| 18 | case 'SET_SETTINGS': |
| 19 | return { |
| 20 | ...state, |
| 21 | settings: action.value, |
| 22 | }; |
| 23 | case 'SET_VOICES': |
| 24 | return { |
| 25 | ...state, |
| 26 | voices: action.value, |
| 27 | }; |
| 28 | } |
| 29 | |
| 30 | return state; |
| 31 | }; |
| 32 | |
| 33 | export default reducer; |
| 34 |