選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

reducer.js 563B

12345678910111213141516171819202122232425
  1. // @flow
  2. import { ReducerRegistry } from '../redux';
  3. import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
  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. });