Skip to content

Instantly share code, notes, and snippets.

@ericstumper
Created June 3, 2017 14:38
Show Gist options
  • Save ericstumper/65e892d815680657e9aa629d81edb15a to your computer and use it in GitHub Desktop.
Save ericstumper/65e892d815680657e9aa629d81edb15a to your computer and use it in GitHub Desktop.
Reducer
[LOAD_METER_DATA_LATEST_FRAME]: (state, action) => {
const currentPropertyId = state.data.findIndex(
x => x.id === action.payload
);
return {
...state,
data: {
...state.data,
[currentPropertyId]: {
...state.data[currentPropertyId],
meterDataLatestFrame: {
data: null,
error: false,
loading: true,
},
},
},
};
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment