2017-12-14 17:02:32 +00:00
|
|
|
// @flow
|
|
|
|
|
2018-01-17 11:19:10 +00:00
|
|
|
import { PersistencyRegistry, ReducerRegistry } from '../redux';
|
2017-12-14 17:02:32 +00:00
|
|
|
|
2018-01-29 22:20:38 +00:00
|
|
|
import { PROFILE_UPDATED } from './actionTypes';
|
|
|
|
|
2017-12-14 17:02:32 +00:00
|
|
|
const DEFAULT_STATE = {
|
|
|
|
profile: {}
|
|
|
|
};
|
|
|
|
|
|
|
|
const STORE_NAME = 'features/base/profile';
|
|
|
|
|
2018-01-17 11:19:10 +00:00
|
|
|
PersistencyRegistry.register(STORE_NAME, {
|
|
|
|
profile: true
|
|
|
|
});
|
|
|
|
|
2017-12-14 17:02:32 +00:00
|
|
|
ReducerRegistry.register(
|
|
|
|
STORE_NAME, (state = DEFAULT_STATE, action) => {
|
|
|
|
switch (action.type) {
|
|
|
|
case PROFILE_UPDATED:
|
|
|
|
return {
|
|
|
|
profile: action.profile
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
return state;
|
|
|
|
});
|