Allow custom options for charts

This commit is contained in:
Thomas Nordquist
2019-06-17 16:37:13 +02:00
parent 2296143883
commit 0f9c2cd36f
10 changed files with 367 additions and 39 deletions

View File

@@ -66,7 +66,7 @@ export const addChart = (chartParameters: ChartParameters) => async (
dispatch: Dispatch<any>,
getState: () => AppState
) => {
let chartExists = Boolean(
const chartExists = Boolean(
getState()
.charts.get('charts')
.find(chart => chart.topic === chartParameters.topic && chart.dotPath === chartParameters.dotPath)
@@ -82,6 +82,19 @@ export const addChart = (chartParameters: ChartParameters) => async (
dispatch(saveCharts())
}
export const updateChart = (chartParameters: ChartParameters) => async (
dispatch: Dispatch<any>,
getState: () => AppState
) => {
dispatch({
type: ActionTypes.CHARTS_UPDATE,
topic: chartParameters.topic,
dotPath: chartParameters.dotPath,
parameters: chartParameters,
})
dispatch(saveCharts())
}
export const removeChart = (chartParameters: ChartParameters) => async (
dispatch: Dispatch<any>,
getState: () => AppState