β¬ οΈ Back to Table of Contents
π useThrottledRefHistory¶
π Analysis Summary¶
| Metric | Count |
|---|---|
| π§ Functions | 1 |
| π¦ Imports | 6 |
| π Type Aliases | 2 |
π Table of Contents¶
π οΈ File Location:¶
π packages/core/useThrottledRefHistory/index.ts
π¦ Imports¶
| Name | Source |
|---|---|
MaybeRef |
vue |
Ref |
vue |
UseRefHistoryOptions |
../useRefHistory |
UseRefHistoryReturn |
../useRefHistory |
throttleFilter |
@vueuse/shared |
useRefHistory |
../useRefHistory |
Functions¶
useThrottledRefHistory(source: Ref<Raw>, options: UseThrottledRefHistoryOptions<Raw, Seriβ¦): UseThrottledRefHistoryReturn<Raw, Serialized>¶
Shorthand for useRefHistory with throttled filter.
Parameters:
sourceany: No descriptionoptionsany: No description
See: https://vueuse.org/useThrottledRefHistory
Raw JSDoc
Calls:
throttleFilter (from @vueuse/shared)useRefHistory (from ../useRefHistory)
Code
export function useThrottledRefHistory<Raw, Serialized = Raw>(
source: Ref<Raw>,
options: UseThrottledRefHistoryOptions<Raw, Serialized> = {},
): UseThrottledRefHistoryReturn<Raw, Serialized> {
const { throttle = 200, trailing = true } = options
const filter = throttleFilter(throttle, trailing)
const history = useRefHistory(source, { ...options, eventFilter: filter })
return {
...history,
}
}
Type Aliases¶
UseThrottledRefHistoryOptions<Raw, Serialized = Raw>¶
type UseThrottledRefHistoryOptions<Raw, Serialized = Raw> = Omit<UseRefHistoryOptions<Raw, Serialized>, 'eventFilter'> & { throttle?: MaybeRef<number>, trailing?: boolean };
UseThrottledRefHistoryReturn<Raw, Serialized = Raw>¶
Generated by Syntax Scribe