Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 25x 1x 1x 1x 1x 1x 1x 1x 1x 23x | import { OPEN_BRANCHES, CLOSE_BRANCHES } from "../actions/branches";
export default function branches(state = [], action) {
switch (action.type) {
case OPEN_BRANCHES: {
const newState = state.slice(0);
Eif (!newState.includes(action.payload)) {
newState.push(action.payload);
}
return newState;
}
case CLOSE_BRANCHES: {
const newState = state.slice(0);
const index = newState.indexOf(action.payload);
newState.splice(index, 1);
return newState;
}
default:
return state;
}
}
|