You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
425 B
TypeScript
17 lines
425 B
TypeScript
export default function reducer(state = [], action) {
|
|
switch (action.type) {
|
|
case 'CONFIG_LOAD_FULFILLED': {
|
|
return state.concat(action.payload.testdata);
|
|
}
|
|
case 'CONFIG_DELETE_TESTDATA': {
|
|
const next = state.filter((i) => i.name !== action.value[0]);
|
|
return next;
|
|
}
|
|
case 'CONFIG_ADD_TESTDATA': {
|
|
return state.concat([action.value]);
|
|
}
|
|
default:
|
|
return state;
|
|
}
|
|
}
|