Category | Utilities |
---|---|
Export Size | 407 B |
Last Changed | 2 weeks ago |
Use timeout to poll something. It's will trigger callback after last task is done.
import { useTimeoutPoll } from '@vueuse/core' const count = ref(0) async function fetchData() { await promiseTimeout(1000) count.value++ } // Only trigger after last fetch is done const { isActive, pause, resume } = useTimeoutPoll(fetchData, 1000)
export declare function useTimeoutPoll( fn: () => Awaitable<void>, interval: MaybeRefOrGetter<number>, timeoutPollOptions?: UseTimeoutFnOptions ): Pausable
© 2019-present Anthony Fu
Licensed under the MIT License.
https://vueuse.org/core/useTimeoutPoll/