Skip to content

Commit 6384fa7

Browse files
Update workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal/WorkflowNode.kt
Co-authored-by: Ray Ryan <[email protected]>
1 parent cb3e0f2 commit 6384fa7

File tree

1 file changed

+8
-0
lines changed
  • workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal

1 file changed

+8
-0
lines changed

workflow-runtime/src/commonMain/kotlin/com/squareup/workflow1/internal/WorkflowNode.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,14 @@ internal class WorkflowNode<PropsT, StateT, OutputT, RenderingT>(
305305
) {
306306
// If we are using the optimization, always return to the parent, so we carry a path that
307307
// notes that the subtree did change all the way to the root.
308+
//
309+
// We don't need that without the optimization because there is nothing
310+
// to output from the root of the runtime -- the output has propagated
311+
// as far as it needs to causing all corresponding state changes.
312+
//
313+
// However, the root and the path down to the changed nodes must always
314+
// re-render now, so this is the implementation detail of how we get
315+
// subtreeStateDidChange = true on that entire path to the root.
308316
emitAppliedActionToParent(aggregateActionApplied)
309317
} else {
310318
aggregateActionApplied

0 commit comments

Comments
 (0)