web-installer/src/redux/reducers/substrateChainsReducer.js
// Reducers to add and remove from list of all substrate nodes
Reducers to add and remove from list of all substrate nodes
Reducers to add and remove from list of all substrate nodes
function allNodes(state = [], action) {
  switch (action.type) {
    case ADD_NODE_SUBSTRATE:
      if (state.includes(action.payload.id)) {
        return state;
      }
      return state.concat(action.payload.id);
    case REMOVE_NODE_SUBSTRATE:
      return state.filter((config) => config !== action.payload.id);
    default:
      return state;
  }
}
function allNodes ( state = [ ] , action ) { switch ( action . type ) { case ADD_NODE_SUBSTRATE : if ( state . includes ( action . payload . id ) ) { return state ; } return state . concat ( action . payload . id ) ; case REMOVE_NODE_SUBSTRATE : return state . filter ( ( config ) => config !== action . payload . id ) ; default : return state ; } }
Reducers to add and remove from list of all substrate nodes
Reducers to add and remove from list of all substrate nodes