Move date range selection into redux.

This commit is contained in:
Mike Cao committed 2020-08-31 14:11:30 -07:00
1 parent d06c077019
commit c5cb19a3bf
21 files changed
+141 -138

No files matched your search

+2 -2
View File
@@ -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;