Skip to content

⬅️ Back to Table of Contents

📄 index.ts

📊 Analysis Summary

Metric Count
🔧 Functions 7
📦 Imports 13
📊 Variables & Constants 1
🟢 Vue Composition API 1
📐 Interfaces 1

📚 Table of Contents

🛠️ File Location:

📂 packages/rxjs/useExtractedObservable/index.ts

📦 Imports

Name Source
MapOldSources @vueuse/shared
MapSources @vueuse/shared
MultiWatchSources @vueuse/shared
Subscription rxjs
ShallowRef vue
WatchOptions vue
WatchSource vue
UseObservableOptions ../useObservable
WatchExtractedObservableCallback ../watchExtractedObservable
tryOnScopeDispose @vueuse/shared
readonly vue
shallowRef vue
watch vue

Variables & Constants

Name Type Kind Value Exported
subscription Subscription | undefined let/var *not shown*

Vue Composition API

Name Type Reactive Variables Composables
watch watch none none

Functions

`useExtractedObservable(sources: [...T], extractor: WatchExtractedObservableCallback<

MapSources<T>,
MapOldSources<T, Immediate>,
E

, options: UseExtractedObservableOptions, watchOptions: WatchOptions): Readonly>`

Code
export function useExtractedObservable<
  T extends MultiWatchSources,
  E,
  Immediate extends Readonly<boolean> = false,
>(
  sources: [...T],
  extractor: WatchExtractedObservableCallback<
    MapSources<T>,
    MapOldSources<T, Immediate>,
    E
  >,
  options?: UseExtractedObservableOptions<E>,
  watchOptions?: WatchOptions<Immediate>,
): Readonly<ShallowRef<E>>
  • Parameters:
  • sources: [...T]
  • `extractor: WatchExtractedObservableCallback< MapSources, MapOldSources, E

    `

  • options: UseExtractedObservableOptions<E>
  • watchOptions: WatchOptions<Immediate>
  • Return Type: Readonly<ShallowRef<E>>

error(err: any): void

Code
(err) => {
          options?.onError?.(err)
        }
  • Parameters:
  • err: any
  • Return Type: void
  • Calls:
  • options?.onError

complete(): void

Code
() => {
          options?.onComplete?.()
        }
  • Return Type: void
  • Calls:
  • options?.onComplete

next(val: any): void

Code
(val) => {
          obsRef.value = val
        }
  • Parameters:
  • val: any
  • Return Type: void

error(err: any): void

Code
(err) => {
          options?.onError?.(err)
        }
  • Parameters:
  • err: any
  • Return Type: void
  • Calls:
  • options?.onError

complete(): void

Code
() => {
          options?.onComplete?.()
        }
  • Return Type: void
  • Calls:
  • options?.onComplete

next(val: any): void

Code
(val) => {
          obsRef.value = val
        }
  • Parameters:
  • val: any
  • Return Type: void

Interfaces

UseExtractedObservableOptions<E>

Interface Code
export interface UseExtractedObservableOptions<E> extends UseObservableOptions<E> {
  onComplete?: () => void
}

Properties

Name Type Optional Description
onComplete () => void