Skip to content

⬅️ 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:

  • source any: No description
  • options any: No description

See: https://vueuse.org/useThrottledRefHistory

Raw JSDoc
/**
 * Shorthand for [useRefHistory](https://vueuse.org/useRefHistory) with throttled filter.
 *
 * @see https://vueuse.org/useThrottledRefHistory
 * @param source
 * @param options
 */

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>

type UseThrottledRefHistoryReturn<Raw, Serialized = Raw> = UseRefHistoryReturn<Raw, Serialized>;

Generated by Syntax Scribe