File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -128,7 +128,7 @@ export function computed<T>(getter: (previousValue?: T) => T): () => T {
128128 subsTail : undefined ,
129129 deps : undefined ,
130130 depsTail : undefined ,
131- flags : 17 as ReactiveFlags . Mutable | ReactiveFlags . Dirty ,
131+ flags : 0 satisfies ReactiveFlags . None ,
132132 getter : getter as ( previousValue ?: unknown ) => unknown ,
133133 } ) as ( ) => T ;
134134}
@@ -272,6 +272,14 @@ function computedOper<T>(this: Computed<T>): T {
272272 shallowPropagate ( subs ) ;
273273 }
274274 }
275+ } else if ( ! flags ) {
276+ this . flags = 1 satisfies ReactiveFlags . Mutable ;
277+ const prevSub = setCurrentSub ( this ) ;
278+ try {
279+ this . value = this . getter ( ) ;
280+ } finally {
281+ activeSub = prevSub ;
282+ }
275283 }
276284 const sub = activeSub ;
277285 if ( sub !== undefined ) {
You can’t perform that action at this time.
0 commit comments