diff --git a/packages/core/src/runtime/dataflow.ts b/packages/core/src/runtime/dataflow.ts index b980bb5..141a2b2 100644 --- a/packages/core/src/runtime/dataflow.ts +++ b/packages/core/src/runtime/dataflow.ts @@ -95,10 +95,14 @@ export class Graph implements ObservingGraph { if (workSet.size === 0) break; + const updatedSubjects = new FlexSet(this.subjectIdCanonicalizer); workSet.forEach(objectId => { this.observersOf(objectId).forEach((subjectId: SubjectId) => { - this.forgetSubject(subjectId); - this.withSubject(subjectId, () => repairNode(subjectId)); + if (!updatedSubjects.has(subjectId)) { + updatedSubjects.add(subjectId); + this.forgetSubject(subjectId); + this.withSubject(subjectId, () => repairNode(subjectId)); + } }); }); }