useDebouncedLoading.ts 337 B

1234567891011121314
  1. // Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. import { ref } from 'vue'
  3. import { refDebounced } from '@vueuse/shared'
  4. export const useDebouncedLoading = (ms = 300) => {
  5. const loading = ref(false)
  6. const debouncedLoading = refDebounced(loading, ms)
  7. return {
  8. loading,
  9. debouncedLoading,
  10. }
  11. }