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 752B

123456789101112131415161718192021222324252627282930
  1. import PersistenceRegistry from '../base/redux/PersistenceRegistry';
  2. import ReducerRegistry from '../base/redux/ReducerRegistry';
  3. import { SET_SCREENSHOT_CAPTURE } from './actionTypes';
  4. PersistenceRegistry.register('features/screnshot-capture', true, {
  5. capturesEnabled: false
  6. });
  7. const DEFAULT_STATE = {
  8. capturesEnabled: false
  9. };
  10. export interface IScreenshotCaptureState {
  11. capturesEnabled: boolean;
  12. }
  13. ReducerRegistry.register<IScreenshotCaptureState>('features/screenshot-capture',
  14. (state = DEFAULT_STATE, action): IScreenshotCaptureState => {
  15. switch (action.type) {
  16. case SET_SCREENSHOT_CAPTURE: {
  17. return {
  18. ...state,
  19. capturesEnabled: action.payload
  20. };
  21. }
  22. }
  23. return state;
  24. });