Skip to main content

An effect lifecycle change

In previous versions of the Composable Architecture, a root store’s effects continued to run even after the store’s lifetime. In 1.18, this leak has been fixed, and a root store’s effects will be cancelled when the store deallocates.
Breaking Change: A root store’s effects will now be cancelled when the store deallocates. This fixes a memory leak but may affect code that depended on the previous behavior.
If you depend on a store’s fire-and-forget effect to outlive the store, for example if you want to ensure an analytics or persistence effect proceeds without cancellation, perform this work in an unstructured task, instead:
 return .run { _ in
-  await analytics.track(/* ... */)
+  Task {
+    await analytics.track(/* ... */)
+  }
 }

A UIKit navigation helper

Our Swift Navigation library ships with many UIKit tools, and the Composable Architecture integrates with many of them, but up till now it has lacked support for trait-based navigation by pushing an element of StackState. This has been fixed with a new endpoint on the push trait that takes a state parameter:
traitCollection.push(state: Path.State.detail(/* ... */))

Build docs developers (and LLMs) love