mst-query
mst-query copied to clipboard
Support interval fetch
Can you add more interval fetch for query?
I'd like to add this eventually, but in the meantime you can get the same thing with useEffect
:
const { query } = useEffect(store.query);
useEffect(() => {
const id = setInterval(() => {
query.invalidate()
}, 5000);
return () => {
clearInterval(id);
}:
}, [query]);
I'd like to add this eventually, but in the meantime you can get the same thing with
useEffect
:const { query } = useEffect(store.query); useEffect(() => { const id = setInterval(() => { query.invalidate() }, 5000); return () => { clearInterval(id); }: }, [query]);
Yah! me too. But i think own lib should support for this to avoid boilerplate code