You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
hexmap/common/src/reducers/UserReducer.ts

15 lines
473 B

import {USER_ACTIVE_COLOR, UserAction} from "../actions/UserAction";
import {UserState} from "../state/UserState";
export function userReducer(oldState: UserState, action: UserAction): UserState {
switch (action.type) {
case USER_ACTIVE_COLOR:
if (oldState.activeColor === action.color) {
return oldState
}
return {
...oldState,
activeColor: action.color
}
}
}