Skip to content

⬅️ Back to Table of Contents

📄 computedWithControl

📊 Analysis Summary

Metric Count
🔧 Functions 2
📦 Imports 10
📊 Variables & Constants 1
🟢 Vue Composition API 1
📐 Interfaces 3
📑 Type Aliases 1

📚 Table of Contents

🛠️ File Location:

📂 packages/shared/computedWithControl/index.ts

📦 Imports

Name Source
ComputedGetter vue
ComputedRef vue
MultiWatchSources vue
WatchOptions vue
WatchSource vue
WritableComputedOptions vue
WritableComputedRef vue
Fn ../utils
customRef vue
watch vue

Variables & Constants

Name Type Kind Value Exported
controlledComputed { <T>(source: any, fn: ComputedGetter... const computedWithControl

Vue Composition API

Name Type Reactive Variables Composables
watch watch none none

Functions

computedWithControl(source: WatchSource | MultiWatchSources, fn: ComputedGetter<T>, options: WatchOptions): ComputedRefWithControl<T>

Parameters:

  • source WatchSource | MultiWatchSources
  • fn ComputedGetter<T>
  • options WatchOptions

Returns: ComputedRefWithControl<T>

Code
export function computedWithControl<T>(
  source: WatchSource | MultiWatchSources,
  fn: ComputedGetter<T>,
  options?: WatchOptions,
): ComputedRefWithControl<T>

Internal helpers

Declared inside another function in this file.

update(): void

Returns: void

Calls:

  • trigger
Code
() => {
    dirty = true
    trigger()
  }

Interfaces

ComputedWithControlRefExtra

Interface Code
export interface ComputedWithControlRefExtra {
  /**
   * Force update the computed value.
   */
  trigger: () => void
}

Properties

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

ComputedRefWithControl<T>

Interface Code
export interface ComputedRefWithControl<T> extends ComputedRef<T>, ComputedWithControlRefExtra {}

WritableComputedRefWithControl<T>

Interface Code
export interface WritableComputedRefWithControl<T> extends WritableComputedRef<T>, ComputedWithControlRefExtra {}

Type Aliases

ComputedWithControlRef<T = any>

type ComputedWithControlRef<T = any> = ComputedRefWithControl<T> | WritableComputedRefWithControl<T>;

Generated by Syntax Scribe