fix: model list cache data refresh

main
jialin 1 year ago
parent 1fe42a6eda
commit af02db17cf

@ -1,6 +1,6 @@
import { WatchEventType } from '@/config';
import _ from 'lodash';
import { useRef } from 'react';
import { useEffect, useRef } from 'react';
interface ChunkedCollection {
ids: string[];
@ -20,6 +20,10 @@ export function useUpdateChunkedList(options: {
const cacheDataListRef = useRef<any[]>(options.dataList || []);
const timerRef = useRef<any>(null);
useEffect(() => {
cacheDataListRef.current = [...(options.dataList || [])];
}, [options.dataList]);
const debounceUpdateChunckedList = () => {
clearTimeout(timerRef.current);
timerRef.current = setTimeout(() => {

Loading…
Cancel
Save