From 34ee05633dc701e8cfa22df33d37f035a7df8617 Mon Sep 17 00:00:00 2001 From: binge_c-admin Date: Wed, 18 Jun 2025 20:45:10 +0800 Subject: [PATCH 1/2] perf(computedWithControl): Optimize with shallowRef --- packages/shared/computedWithControl/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/shared/computedWithControl/index.ts b/packages/shared/computedWithControl/index.ts index 329b9599ba5..913bce0d16b 100644 --- a/packages/shared/computedWithControl/index.ts +++ b/packages/shared/computedWithControl/index.ts @@ -37,10 +37,10 @@ export function computedWithControl( let v: T = undefined! let track: Fn let trigger: Fn - const dirty = shallowRef(true) + let dirty = true const update = () => { - dirty.value = true + dirty = true trigger() } @@ -55,9 +55,9 @@ export function computedWithControl( return { get() { - if (dirty.value) { + if (dirty) { v = get(v) - dirty.value = false + dirty = false } track() return v From 118bdb7c155b0145efe9c2a2db73a01f1e9fb017 Mon Sep 17 00:00:00 2001 From: binge_c-admin Date: Wed, 18 Jun 2025 21:56:35 +0800 Subject: [PATCH 2/2] perf(computedWithControl): Remove unused shallowRef import --- packages/shared/computedWithControl/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/shared/computedWithControl/index.ts b/packages/shared/computedWithControl/index.ts index 913bce0d16b..ec9b205abe7 100644 --- a/packages/shared/computedWithControl/index.ts +++ b/packages/shared/computedWithControl/index.ts @@ -1,6 +1,6 @@ import type { ComputedGetter, ComputedRef, WatchSource, WritableComputedOptions, WritableComputedRef } from 'vue' import type { Fn } from '../utils' -import { customRef, shallowRef, watch } from 'vue' +import { customRef, watch } from 'vue' export interface ComputedWithControlRefExtra { /** pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy