UNPKG

@veecode-platform/plugin-kong-service-manager

Version:

17 lines (15 loc) 488 B
const initialFieldsState = []; const FieldsReducer = (state, action) => { switch (action.type) { case "ADD_FIELDS": return action.payload; case "REMOVE_FIELD": return state.filter((item) => item.name !== action.payload); case "UPDATE_FIELD": return state.map((item) => item.name === action.payload.name ? action.payload : item); default: return state; } }; export { FieldsReducer, initialFieldsState }; //# sourceMappingURL=reducer.esm.js.map