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.js 563B

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