NM
Size: a a a
NM
VZ
VZ
NM
АД
VZ
DM
АД
const addUserConfigs = ({ id, ...rest }) => ({
type: "ADD_USER_CONFIGS",
userId: id,
userConfigs: rest
});
const getUserConfigs = userId => ({
type: "GET_USER_CONFIGS",
userId
});
function usersConfigs(state = {}, action) {
switch (action.type) {
case "GET_USER_CONFIGS":
return state[action.userId];
case "ADD_USER_CONFIGS":
return { ...state, [action.userId]: action.userConfigs };
default:
return state;
}
}NM
NM
АД
NM
АД
АД
NM
NM
const addUserConfigs = ({ id, ...rest }) => ({
type: "ADD_USER_CONFIGS",
userId: id,
userConfigs: rest
});
const getUserConfigs = userId => ({
type: "GET_USER_CONFIGS",
userId
});
function usersConfigs(state = {}, action) {
switch (action.type) {
case "GET_USER_CONFIGS":
return state[action.userId];
case "ADD_USER_CONFIGS":
return { ...state, [action.userId]: action.userConfigs };
default:
return state;
}
}АД
α
α
NM