diff --git a/packages/shared/refDebounced/index.ts b/packages/shared/refDebounced/index.ts index 1faa4d1be30..4050edb89cf 100644 --- a/packages/shared/refDebounced/index.ts +++ b/packages/shared/refDebounced/index.ts @@ -1,17 +1,14 @@ import type { Ref } from 'vue-demi' import { ref, watch } from 'vue-demi' import { useDebounceFn } from '../useDebounceFn' -import type { DebounceFilterOptions } from '../utils' +import type { DebounceFilterOptions, MaybeComputedRef } from '../utils' /** * Debounce updates of a ref. * * @return A new debounced ref. */ -export function refDebounced(value: Ref, ms = 200, options: DebounceFilterOptions = {}): Readonly> { - if (ms <= 0) - return value - +export function refDebounced(value: Ref, ms: MaybeComputedRef = 200, options: DebounceFilterOptions = {}): Readonly> { const debounced = ref(value.value as T) as Ref const updater = useDebounceFn(() => {