@@ -492,10 +492,11 @@ But this means that you must explicitly thread all dependencies from the root of
492492through to every child feature. This can be arduous and make it difficult to add, remove or change
493493dependencies.
494494
495- The library comes with a tool for managing dependencies in a more ergonomic manner, and even comes
496- with some common dependencies pre-integrated allowing you to access them with no additional work.
497- For example, the ` date ` dependency ships with the library so that you can declare your feature's
498- dependence on that functionality in the following way:
495+ The Composable Architecture now uses the [ Dependencies] [ swift-dependencies ] library to manage
496+ dependencies in a more ergonomic manner, and even comes with some common dependencies pre-integrated
497+ allowing you to access them with no additional work. For example, the ` date ` dependency ships with
498+ the library so that you can declare your feature's dependence on that functionality in the following
499+ way:
499500
500501``` swift
501502struct Feature : ReducerProtocol {
@@ -508,6 +509,17 @@ struct Feature: ReducerProtocol {
508509With that one declaration you can stop explicitly passing the date dependency through every layer
509510of your application. A date function will be automatically provided to your feature's reducer.
510511
512+ > Important: [ Dependencies] [ swift-dependencies ] is powered by Swift task locals and is intended to
513+ > be used in structured contexts. If your reducer's effects make use of escaping closures, then
514+ > you must do additional work to propagate the dependencies to that context. For example, using
515+ > a dependency from within a Combine operator such as ` .map ` , ` .flatMap ` and even ` .filter ` will
516+ > use the default dependency value.
517+ >
518+ > See the [ Dependencies documentation] [ swift-dependencies-docs ] on
519+ > [ Dependency lifetimes] [ swift-dependencies-docs-lifetimes ] for more information, and how to
520+ > integrate the ` @Dependency ` property wrapper into pre-structured concurrency using the
521+ > ` withEscapedDependencies ` function.
522+
511523For domain-specific dependencies you can perform a little bit of upfront work to register your
512524dependency with the system, and then it will be automatically available to every layer in your
513525application:
@@ -538,6 +550,10 @@ struct Feature: ReducerProtocol {
538550For more information on designing your dependencies and providing live and test dependencies, see
539551our < doc:Testing > article.
540552
553+ [ swift-dependencies ] : https://github.com/pointfreeco/swift-dependencies
554+ [ swift-dependencies-docs ] : https://pointfreeco.github.io/swift-dependencies/main/documentation/dependencies/
555+ [ swift-dependencies-docs-lifetimes ] : https://pointfreeco.github.io/swift-dependencies/main/documentation/dependencies/lifetimes
556+
541557## Stores
542558
543559Stores can be initialized from an initial state and an instance of a type conforming to
0 commit comments