您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

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. });