add comment

This commit is contained in:
Abhinav 2024-01-24 13:35:00 +05:30
parent 603fde07d1
commit 6735075880

View file

@ -1,6 +1,9 @@
import { useEffect, useRef } from 'react';
import { isPromise } from '../utils';
// useEffectSingleThreaded is a useEffect that will only run one at a time, and will
// caches the latest deps of requests that come in while it is running, and will
// run that after the current run is complete.
export default function useEffectSingleThreaded(
fn: (deps) => void | Promise<void>,
deps: any[]