mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-20 14:39:06 +00:00
improvements in react-query
- fetch to useFetch hook - refetch every 10s - sync browser tabs with experimental broadcastQueryClient
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useMutation, useQuery, useQueryClient } from 'react-query';
|
||||
import { useMutation, useQueryClient } from 'react-query';
|
||||
import { useEffect } from 'react';
|
||||
import {
|
||||
eventsNamespace,
|
||||
@@ -13,10 +13,11 @@ import EventListMenu from '../../menu/EventListMenu.jsx';
|
||||
import { showErrorToast } from '../../../common/helpers/toastManager';
|
||||
import { Skeleton } from '@chakra-ui/skeleton';
|
||||
import style from './List.module.css';
|
||||
import { useFetch } from '../../../app/hooks/useFetch.js';
|
||||
|
||||
export default function EventListWrapper() {
|
||||
const queryClient = useQueryClient();
|
||||
const { data, status, isError, refetch } = useQuery(
|
||||
const { data, status, isError, refetch } = useFetch(
|
||||
eventsNamespace,
|
||||
fetchAllEvents
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user