2022-07-27 10:28:10 +00:00
|
|
|
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app/actionTypes';
|
|
|
|
import ReducerRegistry from '../redux/ReducerRegistry';
|
2019-07-10 11:02:27 +00:00
|
|
|
|
2019-07-13 13:59:58 +00:00
|
|
|
import { USER_INTERACTION_RECEIVED } from './actionTypes';
|
2019-07-10 11:02:27 +00:00
|
|
|
|
2022-07-27 10:28:10 +00:00
|
|
|
export interface IUserInteractionState {
|
|
|
|
interacted?: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2022-09-05 09:05:07 +00:00
|
|
|
ReducerRegistry.register<IUserInteractionState>('features/base/user-interaction',
|
|
|
|
(state = {}, action): IUserInteractionState => {
|
2019-07-10 11:02:27 +00:00
|
|
|
switch (action.type) {
|
|
|
|
case APP_WILL_MOUNT:
|
2019-07-13 13:59:58 +00:00
|
|
|
case APP_WILL_UNMOUNT:
|
2019-07-10 11:02:27 +00:00
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
interacted: false
|
|
|
|
};
|
|
|
|
|
|
|
|
case USER_INTERACTION_RECEIVED:
|
|
|
|
return {
|
|
|
|
...state,
|
|
|
|
interacted: true
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
});
|