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 @@ -138,7 +138,7 @@ export function computed<T>(getter: (previousValue?: T) => T): () => T {
138138 subsTail : undefined ,
139139 deps : undefined ,
140140 depsTail : undefined ,
141- flags : 17 as ReactiveFlags . Mutable | ReactiveFlags . Dirty ,
141+ flags : 0 as ReactiveFlags . None ,
142142 getter : getter as ( previousValue ?: unknown ) => unknown ,
143143 } ) as ( ) => T ;
144144}
@@ -257,6 +257,14 @@ function computedOper<T>(this: Computed<T>): T {
257257 shallowPropagate ( subs ) ;
258258 }
259259 }
260+ } else if ( ! flags ) {
261+ this . flags = 1 satisfies ReactiveFlags . Mutable ;
262+ const prevSub = setActiveSub ( this ) ;
263+ try {
264+ this . value = this . getter ( ) ;
265+ } finally {
266+ activeSub = prevSub ;
267+ }
260268 }
261269 const sub = activeSub ;
262270 if ( sub !== undefined ) {
You can’t perform that action at this time.
0 commit comments