Skip to content

⬅️ Back to Table of Contents

📄 useExtractedObservable

📊 Analysis Summary

Metric Count
🔧 Functions 4
📦 Imports 14
🟢 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
Subscription rxjs
DeepReadonly vue
MultiWatchSources vue
ShallowRef vue
WatchOptions vue
WatchSource vue
UseObservableOptions ../useObservable
WatchExtractedObservableCallback ../watchExtractedObservable
tryOnScopeDispose @vueuse/shared
deepReadonly vue
shallowRef vue
watch vue

Vue Composition API

Name Type Reactive Variables Composables
watch watch none none

Functions

useExtractedObservable(…): DeepReadonly<ShallowRef<E>>

Parameters:

  • sources [...T]
  • extractor `WatchExtractedObservableCallback< MapSources, MapOldSources, E

    `

  • options UseExtractedObservableOptions<E>
  • watchOptions WatchOptions<Immediate>

Returns: DeepReadonly<ShallowRef<E>>

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>,
): DeepReadonly<ShallowRef<E>>

Internal helpers

Declared inside another function in this file.

error(err: any): void

Parameters:

  • err any

Returns: void

Calls:

  • options?.onError
Code
(err) => {
          options?.onError?.(err)
        }

complete(): void

Returns: void

Calls:

  • options?.onComplete
Code
() => {
          options?.onComplete?.()
        }

next(val: any): void

Parameters:

  • val any

Returns: void

Code
(val) => {
          obsRef.value = val
        }

Interfaces

UseExtractedObservableOptions<E>

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

Properties

Name Type Optional Description
onComplete () => void not shown

Generated by Syntax Scribe