add loading

This commit is contained in:
Lachlan Kermode
2020-06-02 13:11:34 +02:00
parent c98d096af7
commit 65befef6e0
6 changed files with 56 additions and 4 deletions

View File

@@ -101,6 +101,7 @@ export function fetchDomain () {
if (Object.values(result).some(resp => resp.hasOwnProperty('error'))) {
throw new Error('Some URLs returned negative. If you are in development, check the server is running')
}
dispatch(toggleFetchingDomain())
return result
})
.catch(err => {
@@ -192,6 +193,20 @@ export function toggleFilter (filter, value) {
}
}
export const SET_LOADING = 'SET_LOADING'
export function setLoading () {
return {
type: SET_LOADING
}
}
export const SET_NOT_LOADING = 'SET_NOT_LOADING'
export function setNotLoading () {
return {
type: SET_NOT_LOADING
}
}
export const UPDATE_TIMERANGE = 'UPDATE_TIMERANGE'
export function updateTimeRange (timerange) {
return {