You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

reducer.ts 997B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import ReducerRegistry from '../redux/ReducerRegistry';
  2. import {
  3. LIB_DID_DISPOSE,
  4. LIB_DID_INIT,
  5. LIB_INIT_ERROR
  6. } from './actionTypes';
  7. /**
  8. * The default/initial redux state of the feature base/lib-jitsi-meet.
  9. *
  10. * @type {Object}
  11. */
  12. const DEFAULT_STATE = {};
  13. export interface ILibJitsiMeetState {
  14. initError?: Error;
  15. initialized?: boolean;
  16. }
  17. ReducerRegistry.register<ILibJitsiMeetState>(
  18. 'features/base/lib-jitsi-meet',
  19. (state = DEFAULT_STATE, action): ILibJitsiMeetState => {
  20. switch (action.type) {
  21. case LIB_DID_DISPOSE:
  22. return DEFAULT_STATE;
  23. case LIB_DID_INIT:
  24. return {
  25. ...state,
  26. initError: undefined,
  27. initialized: true
  28. };
  29. case LIB_INIT_ERROR:
  30. return {
  31. ...state,
  32. initError: action.error,
  33. initialized: false
  34. };
  35. default:
  36. return state;
  37. }
  38. });