Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

reducer.ts 523B

12345678910111213141516171819202122232425
  1. import ReducerRegistry from '../redux/ReducerRegistry';
  2. import { SET_AUDIO_ONLY } from './actionTypes';
  3. export interface IAudioOnlyState {
  4. enabled: boolean;
  5. }
  6. const DEFAULT_STATE = {
  7. enabled: false
  8. };
  9. ReducerRegistry.register<IAudioOnlyState>('features/base/audio-only',
  10. (state = DEFAULT_STATE, action): IAudioOnlyState => {
  11. switch (action.type) {
  12. case SET_AUDIO_ONLY:
  13. return {
  14. ...state,
  15. enabled: action.audioOnly
  16. };
  17. default:
  18. return state;
  19. }
  20. });