Move date range selection into redux.
This commit is contained in:
1 parent
d06c077019
commit
c5cb19a3bf
21 files changed
+141
-138
No files matched your search
+2
-2
@@ -23,9 +23,9 @@ export default function useFetch(url, params = {}, options = {}) {
|
||||
|
||||
useEffect(() => {
|
||||
if (url) {
|
||||
const { interval } = options;
|
||||
const { interval, delay = 0 } = options;
|
||||
|
||||
loadData();
|
||||
setTimeout(() => loadData(), delay);
|
||||
|
||||
const id = interval ? setInterval(() => loadData(), interval) : null;
|
||||
|
||||
|
||||
Reference in new issue
Block a user