Skip to content

⬅️ Back to Table of Contents

📄 index.ts

📊 Analysis Summary

Metric Count
🔧 Functions 1
📦 Imports 2

📚 Table of Contents

🛠️ File Location:

📂 packages/rxjs/useSubscription/index.ts

📦 Imports

Name Source
Unsubscribable rxjs
tryOnScopeDispose @vueuse/shared

Functions

useSubscription(subscription: Unsubscribable): void

Code
export function useSubscription(
  subscription: Unsubscribable,
) {
  tryOnScopeDispose(() => {
    subscription.unsubscribe()
  })
}
  • Parameters:
  • subscription: Unsubscribable
  • Return Type: void
  • Calls:
  • tryOnScopeDispose (from @vueuse/shared)
  • subscription.unsubscribe