Type the data explorer reducer

pull/10616/head
Andrew Watkins 2018-05-11 11:21:36 -07:00
parent 7114ac741f
commit f204be2326
1 changed files with 17 additions and 1 deletions

View File

@ -2,13 +2,29 @@ interface DataExplorerState {
queryIDs: ReadonlyArray<string> queryIDs: ReadonlyArray<string>
} }
interface ActionAddQuery {
type: 'DE_ADD_QUERY'
payload: {
queryID: string
}
}
interface ActionDeleteQuery {
type: 'DE_DELETE_QUERY'
payload: {
queryID: string
}
}
type Action = ActionAddQuery | ActionDeleteQuery
const initialState = { const initialState = {
queryIDs: [], queryIDs: [],
} }
const ui = ( const ui = (
state: DataExplorerState = initialState, state: DataExplorerState = initialState,
action action: Action
): DataExplorerState => { ): DataExplorerState => {
switch (action.type) { switch (action.type) {
// there is an additional reducer for this same action in the queryConfig reducer // there is an additional reducer for this same action in the queryConfig reducer