UNPKG

@zohodesk/hooks

Version:

Unified Component Library - Hooks

14 lines (12 loc) 292 B
export default function singleOpenAccordionReducer(state, action) { if (action.type === '@ACCORDION/RESET') { return state; } const newState = state.map((item, index) => { if (index !== action.data.index) { return false; } return item; }); return newState; }