From f204be23263c86d79443494920587e3dcf6fb7f5 Mon Sep 17 00:00:00 2001 From: Andrew Watkins Date: Fri, 11 May 2018 11:21:36 -0700 Subject: [PATCH] Type the data explorer reducer --- ui/src/data_explorer/reducers/ui.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ui/src/data_explorer/reducers/ui.ts b/ui/src/data_explorer/reducers/ui.ts index 1a791dd92a..f9bb24bba8 100644 --- a/ui/src/data_explorer/reducers/ui.ts +++ b/ui/src/data_explorer/reducers/ui.ts @@ -2,13 +2,29 @@ interface DataExplorerState { queryIDs: ReadonlyArray } +interface ActionAddQuery { + type: 'DE_ADD_QUERY' + payload: { + queryID: string + } +} + +interface ActionDeleteQuery { + type: 'DE_DELETE_QUERY' + payload: { + queryID: string + } +} + +type Action = ActionAddQuery | ActionDeleteQuery + const initialState = { queryIDs: [], } const ui = ( state: DataExplorerState = initialState, - action + action: Action ): DataExplorerState => { switch (action.type) { // there is an additional reducer for this same action in the queryConfig reducer