📄 index.ts¶
📊 Analysis Summary¶
| Metric | Count |
|---|---|
| 🔧 Functions | 1 |
| 📦 Imports | 5 |
| 📑 Type Aliases | 2 |
📚 Table of Contents¶
🛠️ File Location:¶
📂 packages/shared/computedEager/index.ts
📦 Imports¶
| Name | Source |
|---|---|
ShallowRef |
vue |
WatchOptionsBase |
vue |
readonly |
vue |
shallowRef |
vue |
watchEffect |
vue |
Functions¶
computedEager(fn: () => T, options: ComputedEagerOptions): ComputedEagerReturn<T>¶
Code
-
JSDoc:
/** * Note: If you are using Vue 3.4+, you can straight use computed instead. * Because in Vue 3.4+, if computed new value does not change, * computed, effect, watch, watchEffect, render dependencies will not be triggered. * refer: https://github.com/vuejs/core/pull/5912 * * @param fn effect function * @param options WatchOptionsBase * @returns readonly shallowRef */ -
Parameters:
fn: () => Toptions: ComputedEagerOptions- Return Type:
ComputedEagerReturn<T> - Calls:
shallowRef (from vue)watchEffect (from vue)fnreadonly (from vue)