Files
freeCodeCamp/common/app/routes/Profile/redux/index.js
Stuart Taylor 3131c55782 feat(Profile): Reactify profile page (#16743)
* feat(Profile): Reactify profile page

* chore(tidyup): Remove console.log

* fix(timeline): Remove legacy challenges from Timeline render

* fix(style): Remove underline on a:hover
2018-02-19 14:32:14 -06:00

32 lines
663 B
JavaScript

import {
createAction,
createTypes
} from 'berkeleys-redux-utils';
import ns from '../ns.json';
import handleActions from 'berkeleys-redux-utils/lib/handle-actions';
export const types = createTypes([
'onRouteProfile',
'userFound'
], 'profile');
export const onRouteProfile = createAction(types.onRouteProfile);
export const userFound = createAction(types.userFound);
const initialState = {
isUserFound: null
};
export const userFoundSelector = state => state[ns].isUserFound;
export default handleActions(() => (
{
[types.userFound]: (state, { payload }) => ({
...state,
isUserFound: payload
})
}),
initialState,
ns
);