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

1234567891011121314151617181920212223242526272829
  1. import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app/actionTypes';
  2. import ReducerRegistry from '../redux/ReducerRegistry';
  3. import { USER_INTERACTION_RECEIVED } from './actionTypes';
  4. export interface IUserInteractionState {
  5. interacted?: boolean;
  6. }
  7. ReducerRegistry.register<IUserInteractionState>('features/base/user-interaction',
  8. (state = {}, action): IUserInteractionState => {
  9. switch (action.type) {
  10. case APP_WILL_MOUNT:
  11. case APP_WILL_UNMOUNT:
  12. return {
  13. ...state,
  14. interacted: false
  15. };
  16. case USER_INTERACTION_RECEIVED:
  17. return {
  18. ...state,
  19. interacted: true
  20. };
  21. }
  22. return state;
  23. });