src/app/lore/store/reducers/lore.reducer.ts
Function loreReducer
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function loreReducer(state: LoreState = initialLoreState, action: LoreActions): LoreState {
switch (action.type) {
// initial load
case loadLores.type: {
return { ...state, loading: true };
Avoid too many return
statements within this function. Open
Open
return loreAdapter.addOne(payload, { ...state, loading: false });
Avoid too many return
statements within this function. Open
Open
return loreAdapter.removeOne(action.payload, { ...state, loading: false });
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: false };
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: true };
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: false };
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: false, selected: payload.id };
Avoid too many return
statements within this function. Open
Open
return loreAdapter.updateOne({ id: payload.id, changes: payload }, { ...state, loading: false });
Avoid too many return
statements within this function. Open
Open
return state;
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: false };
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: true };
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: true };
Avoid too many return
statements within this function. Open
Open
return { ...state, loading: false };