Type the data explorer reducer
parent
7114ac741f
commit
f204be2326
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue