improvements in react-query

- fetch to useFetch hook
- refetch every 10s
- sync browser tabs with experimental broadcastQueryClient
This commit is contained in:
cv
2021-04-24 15:05:18 +02:00
parent e8bca40653
commit 3f8c6f1192
6 changed files with 32 additions and 15 deletions
+2 -2
View File
@@ -19,11 +19,11 @@ import {
postEvent,
eventNamespace,
} from '../../app/api/eventApi';
import { useQuery } from 'react-query';
import { useEffect, useState } from 'react';
import { useFetch } from '../../app/hooks/useFetch';
export default function SettingsModal(props) {
const { data, status, isError } = useQuery(eventNamespace, fetchEvent);
const { data, status, isError } = useFetch(eventNamespace, fetchEvent);
const [formData, setFormData] = useState({
title: '',
url: '',