Skip to content

Instantly share code, notes, and snippets.

View dummerbd's full-sized avatar

Benjamin Dummer dummerbd

View GitHub Profile
@ejwcodes
ejwcodes / Reducer.js
Created March 3, 2017 20:34
Redux-Grid: Higher Order Component Wrapper for saving state of ag-grid-react to a redux store
export default function grids(state={}, action) {
let payload = action.payload;
switch(action.type) {
case "UPDATE_GRID_STATE": {
const grid = payload.gridName
const gridState = payload.gridState
let nextState = {...state}
nextState[grid] = gridState
return nextState
}