mirror of
https://github.com/muerwre/orchidmap-front.git
synced 2025-04-25 19:16:41 +07:00
redux: completed setters!
This commit is contained in:
parent
0d47cd8773
commit
2656a9fad8
4 changed files with 62 additions and 25 deletions
|
@ -15,12 +15,23 @@ const setUser = (state, { user }) => ({
|
|||
const setEditing = (state, { editing }) => ({ ...state, editing });
|
||||
const setMode = (state, { mode }) => ({ ...state, mode });
|
||||
const setDistance = (state, { distance }) => ({ ...state, distance });
|
||||
const setRouterPoints = (state, { routerPoints }) => ({ ...state, routerPoints });
|
||||
|
||||
const setActiveSticker = (state, { activeSticker }) => ({ ...state, activeSticker });
|
||||
const setLogo = (state, { logo }) => ({ ...state, logo });
|
||||
const setTitle = (state, { title }) => ({ ...state, title });
|
||||
const setAddress = (state, { address }) => ({ ...state, address });
|
||||
|
||||
const HANDLERS = {
|
||||
[ACTIONS.SET_USER]: setUser,
|
||||
[ACTIONS.SET_EDITING]: setEditing,
|
||||
[ACTIONS.SET_MODE]: setMode,
|
||||
[ACTIONS.SET_DISTANCE]: setDistance,
|
||||
[ACTIONS.SET_ROUTER_POINTS]: setRouterPoints,
|
||||
[ACTIONS.SET_ACTIVE_STICKER]: setActiveSticker,
|
||||
[ACTIONS.SET_LOGO]: setLogo,
|
||||
[ACTIONS.SET_TITLE]: setTitle,
|
||||
[ACTIONS.SET_ADDRESS]: setAddress,
|
||||
};
|
||||
|
||||
export const INITIAL_STATE = {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue