UNPKG

virtex

Version:

Small, focused virtual dom library.

25 lines (19 loc) 311 B
/** * Reducer */ function reducer (state, action) { switch (action.type) { case 'INCREMENT': const counters = state.counters.slice(0) counters[action.payload.idx]++ return { ...state, counters } } return state } /** * Exports */ export default reducer