Skip to content

Commit 87045a2

Browse files
fix(reactivity): handle flags are indirectly updated during checkDirty
Co-Authored-By: edison <[email protected]>
1 parent 41140b6 commit 87045a2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

packages/reactivity/src/system.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,8 @@ export function updateDirtyFlag(
192192
if (checkDirty(sub.deps!)) {
193193
sub.flags = flags | SubscriberFlags.Dirty
194194
return true
195+
} else if (sub.flags & SubscriberFlags.Dirty) {
196+
return true
195197
} else {
196198
sub.flags = flags & ~SubscriberFlags.PendingComputed
197199
return false
@@ -202,7 +204,11 @@ export function processComputedUpdate(
202204
computed: Computed,
203205
flags: SubscriberFlags,
204206
): void {
205-
if (flags & SubscriberFlags.Dirty || checkDirty(computed.deps!)) {
207+
if (
208+
flags & SubscriberFlags.Dirty ||
209+
checkDirty(computed.deps!) ||
210+
computed.flags & SubscriberFlags.Dirty
211+
) {
206212
if (computed.update()) {
207213
const subs = computed.subs
208214
if (subs !== undefined) {

0 commit comments

Comments
 (0)