{"owner":"pointfreeco","repo":"swift-composable-architecture","hasSkills":true,"totalSkillsCount":41,"totalTokensCount":14014,"categories":["anthropic-skill"],"hasMcp":false,"mcpConfig":null,"found":["Sources/ComposableArchitecture/Documentation.docc/Extensions/NavigationLinkState.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Action.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectSend.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/IdentifiedAction.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Effect.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectRun.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBuilder.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/ObservableState.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Presents.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Reduce.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Reducer.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBody.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md"],"skills":{"Sources/ComposableArchitecture/Documentation.docc/Extensions/NavigationLinkState.md":"# ``SwiftUI/NavigationLink/init(state:label:fileID:filePath:line:column:)``\n\n## Topics\n\n### Overloads\n\n- ``SwiftUI/NavigationLink/init(_:state:fileID:line:)-1fmz8``\n- ``SwiftUI/NavigationLink/init(_:state:fileID:line:)-3xjq3``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Action.md":"# ``ComposableArchitecture/Reducer/Action``\n\n## Topics\n\n### View actions\n\n- ``ViewAction``\n- ``ViewAction(for:)``\n- ``ViewActionSending``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectSend.md":"# ``ComposableArchitecture/Effect/send(_:)``\n\n## Topics\n\n### Animating actions\n\n- ``Effect/send(_:animation:)``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/IdentifiedAction.md":"# ``ComposableArchitecture/IdentifiedAction``\n\n## Topics\n\n### Supporting types\n\n- ``IdentifiedActionOf``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Effect.md":"# ``ComposableArchitecture/Effect``\n\n## Topics\n\n### Creating an effect\n\n- ``none``\n- ``run(priority:operation:catch:fileID:filePath:line:column:)``\n- ``send(_:)``\n- ``EffectOf``\n\n### Cancellation\n\n- ``cancellable(id:cancelInFlight:)``\n- ``cancel(id:)``\n- ``ComposableArchitecture/withTaskCancellation(id:cancelInFlight:isolation:operation:)``\n- ``_Concurrency/Task/cancel(id:)``\n\n### Composition\n\n- ``map(_:)``\n- ``merge(_:)-5ai73``\n- ``merge(_:)-8ckqn``\n- ``merge(with:)``\n- ``concatenate(_:)-3iza9``\n- ``concatenate(_:)-4gba2``\n- ``concatenate(with:)``\n\n### SwiftUI integration\n\n- ``animation(_:)``\n- ``transaction(_:)``\n\n### Combine integration\n\n- ``publisher(_:)``\n- ``debounce(id:for:scheduler:options:)``\n- ``throttle(id:for:scheduler:latest:)``\n\n### Deprecations\n\n- <doc:EffectDeprecations>\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectRun.md":"# ``ComposableArchitecture/Effect/run(priority:operation:catch:fileID:filePath:line:column:)``\n\n## Topics\n\n### Sending actions\n\n- ``Send``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBuilder.md":"# ``ComposableArchitecture/ReducerBuilder``\n\n## Topics\n\n### Building reducers\n\n- ``buildExpression(_:)-cp3q``\n- ``buildExpression(_:)-9uxku``\n- ``buildBlock(_:)``\n- ``buildBlock()``\n- ``buildPartialBlock(first:)``\n- ``buildPartialBlock(accumulated:next:)``\n- ``buildOptional(_:)``\n- ``buildEither(first:)``\n- ``buildEither(second:)``\n- ``buildArray(_:)``\n- ``buildLimitedAvailability(_:)``\n- ``buildFinalResult(_:)``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/ObservableState.md":"# ``ComposableArchitecture/ObservableState()``\n\n## Topics\n\n### Conformance\n\n- ``ObservableState``\n\n### Change tracking\n\n- ``ObservableStateID``\n- ``ObservationStateRegistrar``\n\n### Supporting macros\n\n- ``ObservationStateTracked()``\n- ``ObservationStateIgnored()``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Presents.md":"# ``ComposableArchitecture/Presents()``\n\n## Topics\n\n### Property wrapper\n\n- ``PresentationState``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Reduce.md":"# ``ComposableArchitecture/Reduce``\n\n## Topics\n\n### Creating a reducer\n\n- ``init(_:)-6xl6k``\n\n### Type erased reducers\n\n- ``init(_:)-9kwa6``\n\n### Reduce conformance\n\n- ``Reducer/body-20w8t``\n- ``Reducer/reduce(into:action:)-1t2ri``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Reducer.md":"# ``ComposableArchitecture/Reducer``\n\nThe ``Reducer`` protocol describes how to evolve the current state of an application to the next\nstate, given an action, and describes what ``Effect``s should be executed later by the store, if\nany. Types that conform to this protocol represent the domain, logic and behavior for a feature.\nConformances to ``Reducer`` can be written by hand, but the ``Reducer()`` can make your reducers \nmore concise and more powerful.\n\n* [Conforming to the Reducer protocol](#Conforming-to-the-Reducer-protocol)\n* [Using the @Reducer macro](#Using-the-Reducer-macro)\n  * [@CasePathable and @dynamicMemberLookup enums](#CasePathable-and-dynamicMemberLookup-enums)\n  * [Automatic fulfillment of reducer requirements](#Automatic-fulfillment-of-reducer-requirements)\n  * [Destination and path reducers](#Destination-and-path-reducers)\n    * [Navigating to non-reducer features](#Navigating-to-non-reducer-features)\n    * [Synthesizing protocol conformances on State and Action](#Synthesizing-protocol-conformances-on-State-and-Action)\n    * [Nested enum reducers](#Nested-enum-reducers)\n  * [Gotchas](#Gotchas)\n    * [Autocomplete](#Autocomplete)\n    * [#Preview and enum reducers](#Preview-and-enum-reducers)\n    * [CI build failures](#CI-build-failures)\n\n## Conforming to the Reducer protocol\n\nThe bare minimum of conforming to the ``Reducer`` protocol is to provide a ``Reducer/State`` type\nthat represents the state your feature needs to do its job, a ``Reducer/Action`` type that\nrepresents the actions users can perform in your feature (as well as actions that effects can\nfeed back into the system), and a ``Reducer/body-20w8t`` property that compose your feature\ntogether with any other features that are needed (such as for navigation).\n\nAs a very simple example, a \"counter\" feature could model its state as a struct holding an integer:\n\n```swift\nstruct CounterFeature: Reducer {\n  @ObservableState\n  struct State {\n    var count = 0\n  }\n}\n```\n\n> Note: We have added the ``ObservableState()`` to `State` here so that the view can automatically\n> observe state changes. In future versions of the library this macro will be automatically applied\n> by the ``Reducer()`` macro.\n\nThe actions would be just two cases for tapping an increment or decrement button:\n\n```swift\nstruct CounterFeature: Reducer {\n  // ...\n  enum Action {\n    case decrementButtonTapped\n    case incrementButtonTapped\n  }\n}\n```\n\nThe logic of your feature is implemented by mutating the feature's current state when an action\ncomes into the system. This is most easily done by constructing a ``Reduce`` inside the\n``Reducer/body-20w8t`` of your reducer:\n\n```swift\nstruct CounterFeature: Reducer {\n  // ...\n  var body: some ReducerOf<Self> {\n    Reduce { state, action in\n      switch action {\n      case .decrementButtonTapped:\n        state.count -= 1\n        return .none\n      case .incrementButtonTapped:\n        state.count += 1  \n        return .none\n      }\n    }\n  }\n}\n```\n\nThe ``Reduce`` reducer's first responsibility is to mutate the feature's current state given an\naction. Its second responsibility is to return effects that will be executed asynchronously and feed\ntheir data back into the system. Currently `Feature` does not need to run any effects, and so\n``Effect/none`` is returned.\n\nIf the feature does need to do effectful work, then more would need to be done. For example, suppose\nthe feature has the ability to start and stop a timer, and with each tick of the timer the `count`\nwill be incremented. That could be done like so:\n\n```swift\nstruct CounterFeature: Reducer {\n  @ObservableState\n  struct State {\n    var count = 0\n  }\n  enum Action {\n    case decrementButtonTapped\n    case incrementButtonTapped\n    case startTimerButtonTapped\n    case stopTimerButtonTapped\n    case timerTick\n  }\n  enum CancelID { case timer }\n\n  var body: some ReducerOf<Self> {\n    Reduce { state, action in\n      switch action {\n      case .decrementButtonTapped:\n        state.count -= 1\n        return .none\n\n      case .incrementButtonTapped:\n        state.count += 1\n        return .none\n\n      case .startTimerButtonTapped:\n        return .run { send in\n          while true {\n            try await Task.sleep(for: .seconds(1))\n            await send(.timerTick)\n          }\n        }\n        .cancellable(CancelID.timer)\n\n      case .stopTimerButtonTapped:\n        return .cancel(CancelID.timer)\n\n      case .timerTick:\n        state.count += 1\n        return .none\n      }\n    }\n  }\n}\n```\n\n> Note: This sample emulates a timer by performing an infinite loop with a `Task.sleep` inside. This\n> is simple to do, but is also inaccurate since small imprecisions can accumulate. It would be\n> better to inject a clock into the feature so that you could use its `timer` method. Read the\n> <doc:DependencyManagement> and <doc:TestingTCA> articles for more information.\n\nThat is the basics of implementing a feature as a conformance to ``Reducer``. \n\n## Using the @Reducer macro\n\nWhile you technically can conform to the ``Reducer`` protocol directly, as we did above, the\n``Reducer()`` macro can automate many aspects of implementing features for you. At a bare minimum,\nall you have to do is annotate your reducer with `@Reducer` and you can even drop the `Reducer`\nconformance:\n\n```diff\n+@Reducer\n-struct CounterFeature: Reducer {\n+struct CounterFeature {\n   @ObservableState\n   struct State {\n     var count = 0\n   }\n   enum Action {\n     case decrementButtonTapped\n     case incrementButtonTapped\n   }\n   var body: some ReducerOf<Self> {\n     Reduce { state, action in\n       switch action {\n       case .decrementButtonTapped:\n         state.count -= 1\n         return .none\n       case .incrementButtonTapped:\n         state.count += 1  \n         return .none\n       }\n     }\n   }\n }\n```\n\nThere are a number of things the ``Reducer()`` macro does for you:\n\n### @CasePathable and @dynamicMemberLookup enums\n\nThe `@Reducer` macro automatically applies the [`@CasePathable`][casepathable-docs] macro to your\n`Action` enum:\n\n```diff\n+@CasePathable\n enum Action {\n   // ...\n }\n```\n\n[Case paths][casepaths-gh] are a tool that bring the power and ergonomics of key paths to enum\ncases, and they are a vital tool for composing reducers together.\n\nIn particular, having this macro applied to your `Action` enum will allow you to use key path\nsyntax for specifying enum cases in various APIs in the library, such as\n``Reducer/ifLet(_:action:destination:fileID:filePath:line:column:)-4ub6q``,\n``Reducer/forEach(_:action:destination:fileID:filePath:line:column:)-9svqb``, ``Scope``, and more.\n\nFurther, if the ``Reducer/State`` of your feature is an enum, which is useful for modeling a feature\nthat can be one of multiple mutually exclusive values, the ``Reducer()`` will apply the\n`@CasePathable` macro, as well as `@dynamicMemberLookup`:\n\n```diff\n+@CasePathable\n+@dynamicMemberLookup\n enum State {\n   // ...\n }\n```\n\nThis will allow you to use key path syntax for specifying case paths to the `State`'s cases, as well\nas allow you to use dot-chaining syntax for optionally extracting a case from the state. This can be\nuseful when using the operators that come with the library that allow for driving navigation from an\nenum of options:\n\n```swift\n.sheet(\n  item: $store.scope(\\.destination?.editForm, action: \\.destination.editForm)\n) { store in\n  FormView(store: store)\n}\n```\n\nThe syntax `\\.destination?.editForm` is only possible due to both `@dynamicMemberLookup` and\n`@CasePathable` being applied to the `State` enum.\n\n### Automatic fulfillment of reducer requirements\n\nThe ``Reducer()`` macro will automatically fill in any ``Reducer`` protocol requirements that you\nleave off. For example, something as simple as this compiles:\n\n```swift\n@Reducer\nstruct Feature {}\n```\n\nThe `@Reducer` macro will automatically insert an empty ``Reducer/State`` struct, an empty\n``Reducer/Action`` enum, and an empty ``Reducer/body-swift.property``. This effectively means that\n`Feature` is a logicless, behaviorless, inert reducer.\n\nHaving these requirements automatically fulfilled for you can be handy for slowly filling them in\nwith their real implementations. For example, this `Feature` reducer could be integrated in a parent\ndomain using the library's navigation tools, all without having implemented any of the domain yet.\nThen, once we are ready we can start implementing the real logic and behavior of the feature.\n\n### Destination and path reducers\n\nThere is a common pattern in the Composable Architecture of representing destinations a feature can\nnavigate to as a reducer that operates on enum state, with a case for each feature that can be\nnavigated to. This is explained in great detail in the <doc:TreeBasedNavigation> and\n<doc:StackBasedNavigation> articles.\n\nThis form of domain modeling can be very powerful, but also incur a bit of boilerplate. For example,\nif a feature can navigate to 3 other features, then one might have a `Destination` reducer like the\nfollowing:\n\n```swift\n@Reducer\nstruct Destination {\n  @ObservableState\n  enum State {\n    case add(FormFeature.State)\n    case detail(DetailFeature.State)\n    case edit(EditFeature.State)\n  }\n  enum Action {\n    case add(FormFeature.Action)\n    case detail(DetailFeature.Action)\n    case edit(EditFeature.Action)\n  }\n  var body: some ReducerOf<Self> {\n    Scope(\\.add, action: \\.add) {\n      FormFeature()\n    }\n    Scope(\\.detail, action: \\.detail) {\n      DetailFeature()\n    }\n    Scope(\\.edit, action: \\.edit) {\n      EditFeature()\n    }\n  }\n}\n```\n\nIt's not the worst code in the world, but it is 24 lines with a lot of repetition, and if we need to\nadd a new destination we must add a case to the ``Reducer/State`` enum, a case to the\n``Reducer/Action`` enum, and a ``Scope`` to the ``Reducer/body-swift.property``.\n\nThe ``Reducer()`` macro is now capable of generating all of this code for you from the following\nsimple declaration\n\n```swift\n@Reducer\nenum Destination {\n  case add(FormFeature)\n  case detail(DetailFeature)\n  case edit(EditFeature)\n}\n```\n\n24 lines of code has become 6. The `@Reducer` macro can now be applied to an _enum_ where each case\nholds onto the reducer that governs the logic and behavior for that case. Further, when using the\n``Reducer/ifLet(_:action:)`` operator with this style of `Destination` enum reducer you can\ncompletely leave off the trailing closure as it can be automatically inferred:\n\n```diff\n Reduce { state, action in\n   // Core feature logic\n }\n .ifLet(\\.$destination, action: \\.destination)\n-{\n-  Destination()\n-}\n```\n\nThis pattern also works for `Path` reducers, which is common when dealing with\n<doc:StackBasedNavigation>, and in that case you can leave off the trailing closure of the\n``Reducer/forEach(_:action:)`` operator:\n\n```diff\nReduce { state, action in\n  // Core feature logic\n}\n.forEach(\\.path, action: \\.path)\n-{\n-  Path()\n-}\n```\n\nFurther, for `Path` reducers in particular, the ``Reducer()`` macro also helps you reduce\nboilerplate when using the initializer \n``SwiftUI/NavigationStack/init(path:root:destination:fileID:filePath:line:column:)`` that comes with the library. \nIn the last trailing closure you can use the ``Store/case`` computed property to switch on the \n`Path.State` enum and extract out a store for each case:\n\n```swift\nNavigationStack(path: $store.scope(\\.path, action: \\.path)) {\n  // Root view\n} destination: { store in\n  switch store.case {\n  case let .add(store):\n    AddView(store: store)\n  case let .detail(store):\n    DetailView(store: store)\n  case let .edit(store):\n    EditView(store: store)\n  }\n}\n```\n\n#### Navigating to non-reducer features\n\nThere are many times that you want to present or navigate to a feature that is not modeled with a\nComposable Architecture reducer. This can happen with legacy features that are not built with the\nComposable Architecture, or with features that are very simple and do not need a fully built\nreducer.\n\nIn those cases you can use the ``ReducerCaseIgnored()`` and ``ReducerCaseEphemeral()`` macros to\nannotate cases that are not powered by reducers. See the documentation for those macros for more\ndetails.\n\nAs an example, suppose that you have a feature that can navigate to multiple features, all of \nwhich are Composable Architecture features except for one:\n\n```swift\n@Reducer\nenum Destination {\n  case add(AddItemFeature)\n  case edit(EditItemFeature)\n  @ReducerCaseIgnored\n  case item(Item)\n}\n```\n\nIn this situation the `.item` case holds onto a plain item and not a full reducer, and for that \nreason we have to ignore it from some of `@Reducer`'s macro expansion.\n\nThen, to present a view from this case one can do:\n\n```swift\n.sheet(item: $store.scope(\\.destination?.item, action: \\.destination.item)) { store in\n  ItemView(item: store.withState { $0 })\n}\n```\n\n> Note: The ``Store/withState(_:)`` is necessary because the value held inside the `.item` case\ndoes not have the ``ObservableState()`` macro applied, nor should it. And so using `withState`\nis a way to get access to the state in the store without any observation taking place.\n\n#### Synthesizing protocol conformances on State and Action\n\nSince the `State` and `Action` types are generated automatically for you when using `@Reducer` on an\nenum, you must extend these types yourself to synthesize conformances of `Equatable`, `Hashable`,\n_etc._:\n\n```swift\n@Reducer\nenum Destination {\n  // ...\n}\nextension Destination.State: Equatable {}\n```\n\n> Note: In Swift <6 the above extension causes a compiler error due to a bug in Swift.\n>\n> To work around this compiler bug, the library provides a version of the `@Reducer` macro that\n> takes two ``ComposableArchitecture/_SynthesizedConformance`` arguments, which allow you to\n> describe the protocols you want to attach to the `State` or `Action` types:\n>\n> ```swift\n> @Reducer(state: .equatable, .sendable, action: .sendable)\n> enum Destination {\n>   // ...\n> }\n> ```\n\n#### Nested enum reducers\n\nThere may be times when an enum reducer may want to nest another enum reducer. To do so, the parent\nenum reducer must specify the child's `Body` associated value and `body` static property explicitly:\n\n```swift\n@Reducer\nenum Modal { /* ... */ }\n\n@Reducer\nenum Destination {\n  case modal(Modal.Body = Modal.body)\n}\n```\n\n### Gotchas\n\n#### Autocomplete\n\nApplying `@Reducer` can break autocompletion in the `body` of the reducer. This is a known\n[issue](https://github.com/apple/swift/issues/69477), and it can generally be worked around by\nproviding additional type hints to the compiler:\n\n 1. Adding an explicit `Reducer` conformance in addition to the macro application can restore\n    autocomplete throughout the `body` of the reducer:\n\n    ```diff\n     @Reducer\n    -struct Feature {\n    +struct Feature: Reducer {\n    ```\n\n 2. Adding explicit generics to instances of `Reduce` in the `body` can restore autocomplete\n    inside the `Reduce`:\n\n    ```diff\n     var body: some Reducer<State, Action> {\n    -  Reduce { state, action in\n    +  Reduce<State, Action> { state, action in\n    ```\n\n#### #Preview and enum reducers\n\nThe `#Preview` macro is not capable of seeing the expansion of any macros since it is a macro \nitself. This means that when using destination and path reducers (see\n<doc:Reducer#Destination-and-path-reducers> above) you cannot construct the cases of the state \nenum inside `#Preview`:\n\n```swift\n#Preview {\n  FeatureView(\n    store: Store(\n      initialState: Feature.State(\n        destination: .edit(EditFeature.State())  // 🛑\n      )\n    ) {\n      Feature()\n    }\n  )\n}\n```\n\nThe `.edit` case is not usable from within `#Preview` since it is generated by the ``Reducer()``\nmacro.\n\nThe workaround is to move the view to a helper that be compiled outside of a macro, and then use it\ninside the macro:\n\n```swift\n#Preview {\n  preview\n}\nprivate var preview: some View {\n  FeatureView(\n    store: Store(\n      initialState: Feature.State(\n        destination: .edit(EditFeature.State())\n      )\n    ) {\n      Feature()\n    }\n  )\n}\n```\n\nYou can use a computed property, free function, or even a dedicated view if you want. You can also\nuse the old, non-macro style of previews by using a `PreviewProvider`:\n\n```swift\nstruct Feature_Previews: PreviewProvider {\n  static var previews: some  View {\n    FeatureView(\n      store: Store(\n        initialState: Feature.State(\n          destination: .edit(EditFeature.State())\n        )\n      ) {\n        Feature()\n      }\n    )\n  }\n}\n```\n\n#### Error: External macro implementation … could not be found\n\nWhen integrating with the Composable Architecture, one may encounter the following error:\n\n> Error: External macro implementation type 'ComposableArchitectureMacros.ReducerMacro' could not be\n> found for macro 'Reducer()'\n\nThis error can show up when the macro has not yet been enabled, which is a separate error that\nshould be visible from Xcode's Issue navigator.\n\nSometimes, however, this error will still emit due to an Xcode bug in which a custom build\nconfiguration name is being used in the project. In general, using a build configuration other than\n\"Debug\" or \"Release\" can trigger upstream build issues with Swift packages, and we recommend only\nusing the default \"Debug\" and \"Release\" build configuration names to avoid the above issue and\nothers.\n\n#### CI build failures\n\nWhen testing your code on an external CI server you may run into errors such as the following:\n\n> Error: CasePathsMacros Target 'CasePathsMacros' must be enabled before it can be used.\n>\n> ComposableArchitectureMacros Target 'ComposableArchitectureMacros' must be enabled before it can\n> be used.\n\nYou can fix this in one of two ways. You can write a default to the CI machine that allows Xcode to\nskip macro validation:\n\n```shell\ndefaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES\n```\n\nOr if you are invoking `xcodebuild` directly in your CI scripts, you can pass the\n`-skipMacroValidation` flag to `xcodebuild` when building your project:\n\n```shell\nxcodebuild -skipMacroValidation …\n```\n\n[casepathable-docs]: https://swiftpackageindex.com/pointfreeco/swift-case-paths/main/documentation/casepaths/casepathable()\n[casepaths-gh]: http://github.com/pointfreeco/swift-case-paths\n\n\n## Topics\n\n### Implementing a reducer\n\n- ``Reducer()``\n- ``State``\n- ``Action``\n- ``body-swift.property``\n- ``Reduce``\n- ``Effect``\n\n### Composing reducers\n\n- ``ReducerBuilder``\n- ``CombineReducers``\n\n### Embedding child features\n\n- ``Scope``\n- ``ifLet(_:action:then:fileID:filePath:line:column:)-2r2pn``\n- ``ifCaseLet(_:action:then:fileID:filePath:line:column:)-7sg8d``\n- ``forEach(_:action:element:fileID:filePath:line:column:)-6zye8``\n- <doc:Navigation>\n\n### Supporting reducers\n\n- ``EmptyReducer``\n- ``BindingReducer``\n- ``Swift/Optional``\n\n### Reducer modifiers\n\n- ``dependency(_:_:)``\n- ``transformDependency(_:transform:)``\n- ``onChange(of:_:)``\n- ``signpost(_:log:)``\n- ``_printChanges(_:)``\n\n### Supporting types\n\n- ``ReducerOf``\n\n### Deprecations\n\n- <doc:ReducerDeprecations>\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBody.md":"# ``ComposableArchitecture/Reducer/body-swift.property``\n\n## Topics\n\n### Associated type\n\n- ``Body``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md)"},"files":{"Sources/ComposableArchitecture/Documentation.docc/Extensions/NavigationLinkState.md":"# ``SwiftUI/NavigationLink/init(state:label:fileID:filePath:line:column:)``\n\n## Topics\n\n### Overloads\n\n- ``SwiftUI/NavigationLink/init(_:state:fileID:line:)-1fmz8``\n- ``SwiftUI/NavigationLink/init(_:state:fileID:line:)-3xjq3``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Action.md":"# ``ComposableArchitecture/Reducer/Action``\n\n## Topics\n\n### View actions\n\n- ``ViewAction``\n- ``ViewAction(for:)``\n- ``ViewActionSending``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectSend.md":"# ``ComposableArchitecture/Effect/send(_:)``\n\n## Topics\n\n### Animating actions\n\n- ``Effect/send(_:animation:)``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/IdentifiedAction.md":"# ``ComposableArchitecture/IdentifiedAction``\n\n## Topics\n\n### Supporting types\n\n- ``IdentifiedActionOf``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Effect.md":"# ``ComposableArchitecture/Effect``\n\n## Topics\n\n### Creating an effect\n\n- ``none``\n- ``run(priority:operation:catch:fileID:filePath:line:column:)``\n- ``send(_:)``\n- ``EffectOf``\n\n### Cancellation\n\n- ``cancellable(id:cancelInFlight:)``\n- ``cancel(id:)``\n- ``ComposableArchitecture/withTaskCancellation(id:cancelInFlight:isolation:operation:)``\n- ``_Concurrency/Task/cancel(id:)``\n\n### Composition\n\n- ``map(_:)``\n- ``merge(_:)-5ai73``\n- ``merge(_:)-8ckqn``\n- ``merge(with:)``\n- ``concatenate(_:)-3iza9``\n- ``concatenate(_:)-4gba2``\n- ``concatenate(with:)``\n\n### SwiftUI integration\n\n- ``animation(_:)``\n- ``transaction(_:)``\n\n### Combine integration\n\n- ``publisher(_:)``\n- ``debounce(id:for:scheduler:options:)``\n- ``throttle(id:for:scheduler:latest:)``\n\n### Deprecations\n\n- <doc:EffectDeprecations>\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectRun.md":"# ``ComposableArchitecture/Effect/run(priority:operation:catch:fileID:filePath:line:column:)``\n\n## Topics\n\n### Sending actions\n\n- ``Send``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBuilder.md":"# ``ComposableArchitecture/ReducerBuilder``\n\n## Topics\n\n### Building reducers\n\n- ``buildExpression(_:)-cp3q``\n- ``buildExpression(_:)-9uxku``\n- ``buildBlock(_:)``\n- ``buildBlock()``\n- ``buildPartialBlock(first:)``\n- ``buildPartialBlock(accumulated:next:)``\n- ``buildOptional(_:)``\n- ``buildEither(first:)``\n- ``buildEither(second:)``\n- ``buildArray(_:)``\n- ``buildLimitedAvailability(_:)``\n- ``buildFinalResult(_:)``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/ObservableState.md":"# ``ComposableArchitecture/ObservableState()``\n\n## Topics\n\n### Conformance\n\n- ``ObservableState``\n\n### Change tracking\n\n- ``ObservableStateID``\n- ``ObservationStateRegistrar``\n\n### Supporting macros\n\n- ``ObservationStateTracked()``\n- ``ObservationStateIgnored()``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Presents.md":"# ``ComposableArchitecture/Presents()``\n\n## Topics\n\n### Property wrapper\n\n- ``PresentationState``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Reduce.md":"# ``ComposableArchitecture/Reduce``\n\n## Topics\n\n### Creating a reducer\n\n- ``init(_:)-6xl6k``\n\n### Type erased reducers\n\n- ``init(_:)-9kwa6``\n\n### Reduce conformance\n\n- ``Reducer/body-20w8t``\n- ``Reducer/reduce(into:action:)-1t2ri``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/Reducer.md":"# ``ComposableArchitecture/Reducer``\n\nThe ``Reducer`` protocol describes how to evolve the current state of an application to the next\nstate, given an action, and describes what ``Effect``s should be executed later by the store, if\nany. Types that conform to this protocol represent the domain, logic and behavior for a feature.\nConformances to ``Reducer`` can be written by hand, but the ``Reducer()`` can make your reducers \nmore concise and more powerful.\n\n* [Conforming to the Reducer protocol](#Conforming-to-the-Reducer-protocol)\n* [Using the @Reducer macro](#Using-the-Reducer-macro)\n  * [@CasePathable and @dynamicMemberLookup enums](#CasePathable-and-dynamicMemberLookup-enums)\n  * [Automatic fulfillment of reducer requirements](#Automatic-fulfillment-of-reducer-requirements)\n  * [Destination and path reducers](#Destination-and-path-reducers)\n    * [Navigating to non-reducer features](#Navigating-to-non-reducer-features)\n    * [Synthesizing protocol conformances on State and Action](#Synthesizing-protocol-conformances-on-State-and-Action)\n    * [Nested enum reducers](#Nested-enum-reducers)\n  * [Gotchas](#Gotchas)\n    * [Autocomplete](#Autocomplete)\n    * [#Preview and enum reducers](#Preview-and-enum-reducers)\n    * [CI build failures](#CI-build-failures)\n\n## Conforming to the Reducer protocol\n\nThe bare minimum of conforming to the ``Reducer`` protocol is to provide a ``Reducer/State`` type\nthat represents the state your feature needs to do its job, a ``Reducer/Action`` type that\nrepresents the actions users can perform in your feature (as well as actions that effects can\nfeed back into the system), and a ``Reducer/body-20w8t`` property that compose your feature\ntogether with any other features that are needed (such as for navigation).\n\nAs a very simple example, a \"counter\" feature could model its state as a struct holding an integer:\n\n```swift\nstruct CounterFeature: Reducer {\n  @ObservableState\n  struct State {\n    var count = 0\n  }\n}\n```\n\n> Note: We have added the ``ObservableState()`` to `State` here so that the view can automatically\n> observe state changes. In future versions of the library this macro will be automatically applied\n> by the ``Reducer()`` macro.\n\nThe actions would be just two cases for tapping an increment or decrement button:\n\n```swift\nstruct CounterFeature: Reducer {\n  // ...\n  enum Action {\n    case decrementButtonTapped\n    case incrementButtonTapped\n  }\n}\n```\n\nThe logic of your feature is implemented by mutating the feature's current state when an action\ncomes into the system. This is most easily done by constructing a ``Reduce`` inside the\n``Reducer/body-20w8t`` of your reducer:\n\n```swift\nstruct CounterFeature: Reducer {\n  // ...\n  var body: some ReducerOf<Self> {\n    Reduce { state, action in\n      switch action {\n      case .decrementButtonTapped:\n        state.count -= 1\n        return .none\n      case .incrementButtonTapped:\n        state.count += 1  \n        return .none\n      }\n    }\n  }\n}\n```\n\nThe ``Reduce`` reducer's first responsibility is to mutate the feature's current state given an\naction. Its second responsibility is to return effects that will be executed asynchronously and feed\ntheir data back into the system. Currently `Feature` does not need to run any effects, and so\n``Effect/none`` is returned.\n\nIf the feature does need to do effectful work, then more would need to be done. For example, suppose\nthe feature has the ability to start and stop a timer, and with each tick of the timer the `count`\nwill be incremented. That could be done like so:\n\n```swift\nstruct CounterFeature: Reducer {\n  @ObservableState\n  struct State {\n    var count = 0\n  }\n  enum Action {\n    case decrementButtonTapped\n    case incrementButtonTapped\n    case startTimerButtonTapped\n    case stopTimerButtonTapped\n    case timerTick\n  }\n  enum CancelID { case timer }\n\n  var body: some ReducerOf<Self> {\n    Reduce { state, action in\n      switch action {\n      case .decrementButtonTapped:\n        state.count -= 1\n        return .none\n\n      case .incrementButtonTapped:\n        state.count += 1\n        return .none\n\n      case .startTimerButtonTapped:\n        return .run { send in\n          while true {\n            try await Task.sleep(for: .seconds(1))\n            await send(.timerTick)\n          }\n        }\n        .cancellable(CancelID.timer)\n\n      case .stopTimerButtonTapped:\n        return .cancel(CancelID.timer)\n\n      case .timerTick:\n        state.count += 1\n        return .none\n      }\n    }\n  }\n}\n```\n\n> Note: This sample emulates a timer by performing an infinite loop with a `Task.sleep` inside. This\n> is simple to do, but is also inaccurate since small imprecisions can accumulate. It would be\n> better to inject a clock into the feature so that you could use its `timer` method. Read the\n> <doc:DependencyManagement> and <doc:TestingTCA> articles for more information.\n\nThat is the basics of implementing a feature as a conformance to ``Reducer``. \n\n## Using the @Reducer macro\n\nWhile you technically can conform to the ``Reducer`` protocol directly, as we did above, the\n``Reducer()`` macro can automate many aspects of implementing features for you. At a bare minimum,\nall you have to do is annotate your reducer with `@Reducer` and you can even drop the `Reducer`\nconformance:\n\n```diff\n+@Reducer\n-struct CounterFeature: Reducer {\n+struct CounterFeature {\n   @ObservableState\n   struct State {\n     var count = 0\n   }\n   enum Action {\n     case decrementButtonTapped\n     case incrementButtonTapped\n   }\n   var body: some ReducerOf<Self> {\n     Reduce { state, action in\n       switch action {\n       case .decrementButtonTapped:\n         state.count -= 1\n         return .none\n       case .incrementButtonTapped:\n         state.count += 1  \n         return .none\n       }\n     }\n   }\n }\n```\n\nThere are a number of things the ``Reducer()`` macro does for you:\n\n### @CasePathable and @dynamicMemberLookup enums\n\nThe `@Reducer` macro automatically applies the [`@CasePathable`][casepathable-docs] macro to your\n`Action` enum:\n\n```diff\n+@CasePathable\n enum Action {\n   // ...\n }\n```\n\n[Case paths][casepaths-gh] are a tool that bring the power and ergonomics of key paths to enum\ncases, and they are a vital tool for composing reducers together.\n\nIn particular, having this macro applied to your `Action` enum will allow you to use key path\nsyntax for specifying enum cases in various APIs in the library, such as\n``Reducer/ifLet(_:action:destination:fileID:filePath:line:column:)-4ub6q``,\n``Reducer/forEach(_:action:destination:fileID:filePath:line:column:)-9svqb``, ``Scope``, and more.\n\nFurther, if the ``Reducer/State`` of your feature is an enum, which is useful for modeling a feature\nthat can be one of multiple mutually exclusive values, the ``Reducer()`` will apply the\n`@CasePathable` macro, as well as `@dynamicMemberLookup`:\n\n```diff\n+@CasePathable\n+@dynamicMemberLookup\n enum State {\n   // ...\n }\n```\n\nThis will allow you to use key path syntax for specifying case paths to the `State`'s cases, as well\nas allow you to use dot-chaining syntax for optionally extracting a case from the state. This can be\nuseful when using the operators that come with the library that allow for driving navigation from an\nenum of options:\n\n```swift\n.sheet(\n  item: $store.scope(\\.destination?.editForm, action: \\.destination.editForm)\n) { store in\n  FormView(store: store)\n}\n```\n\nThe syntax `\\.destination?.editForm` is only possible due to both `@dynamicMemberLookup` and\n`@CasePathable` being applied to the `State` enum.\n\n### Automatic fulfillment of reducer requirements\n\nThe ``Reducer()`` macro will automatically fill in any ``Reducer`` protocol requirements that you\nleave off. For example, something as simple as this compiles:\n\n```swift\n@Reducer\nstruct Feature {}\n```\n\nThe `@Reducer` macro will automatically insert an empty ``Reducer/State`` struct, an empty\n``Reducer/Action`` enum, and an empty ``Reducer/body-swift.property``. This effectively means that\n`Feature` is a logicless, behaviorless, inert reducer.\n\nHaving these requirements automatically fulfilled for you can be handy for slowly filling them in\nwith their real implementations. For example, this `Feature` reducer could be integrated in a parent\ndomain using the library's navigation tools, all without having implemented any of the domain yet.\nThen, once we are ready we can start implementing the real logic and behavior of the feature.\n\n### Destination and path reducers\n\nThere is a common pattern in the Composable Architecture of representing destinations a feature can\nnavigate to as a reducer that operates on enum state, with a case for each feature that can be\nnavigated to. This is explained in great detail in the <doc:TreeBasedNavigation> and\n<doc:StackBasedNavigation> articles.\n\nThis form of domain modeling can be very powerful, but also incur a bit of boilerplate. For example,\nif a feature can navigate to 3 other features, then one might have a `Destination` reducer like the\nfollowing:\n\n```swift\n@Reducer\nstruct Destination {\n  @ObservableState\n  enum State {\n    case add(FormFeature.State)\n    case detail(DetailFeature.State)\n    case edit(EditFeature.State)\n  }\n  enum Action {\n    case add(FormFeature.Action)\n    case detail(DetailFeature.Action)\n    case edit(EditFeature.Action)\n  }\n  var body: some ReducerOf<Self> {\n    Scope(\\.add, action: \\.add) {\n      FormFeature()\n    }\n    Scope(\\.detail, action: \\.detail) {\n      DetailFeature()\n    }\n    Scope(\\.edit, action: \\.edit) {\n      EditFeature()\n    }\n  }\n}\n```\n\nIt's not the worst code in the world, but it is 24 lines with a lot of repetition, and if we need to\nadd a new destination we must add a case to the ``Reducer/State`` enum, a case to the\n``Reducer/Action`` enum, and a ``Scope`` to the ``Reducer/body-swift.property``.\n\nThe ``Reducer()`` macro is now capable of generating all of this code for you from the following\nsimple declaration\n\n```swift\n@Reducer\nenum Destination {\n  case add(FormFeature)\n  case detail(DetailFeature)\n  case edit(EditFeature)\n}\n```\n\n24 lines of code has become 6. The `@Reducer` macro can now be applied to an _enum_ where each case\nholds onto the reducer that governs the logic and behavior for that case. Further, when using the\n``Reducer/ifLet(_:action:)`` operator with this style of `Destination` enum reducer you can\ncompletely leave off the trailing closure as it can be automatically inferred:\n\n```diff\n Reduce { state, action in\n   // Core feature logic\n }\n .ifLet(\\.$destination, action: \\.destination)\n-{\n-  Destination()\n-}\n```\n\nThis pattern also works for `Path` reducers, which is common when dealing with\n<doc:StackBasedNavigation>, and in that case you can leave off the trailing closure of the\n``Reducer/forEach(_:action:)`` operator:\n\n```diff\nReduce { state, action in\n  // Core feature logic\n}\n.forEach(\\.path, action: \\.path)\n-{\n-  Path()\n-}\n```\n\nFurther, for `Path` reducers in particular, the ``Reducer()`` macro also helps you reduce\nboilerplate when using the initializer \n``SwiftUI/NavigationStack/init(path:root:destination:fileID:filePath:line:column:)`` that comes with the library. \nIn the last trailing closure you can use the ``Store/case`` computed property to switch on the \n`Path.State` enum and extract out a store for each case:\n\n```swift\nNavigationStack(path: $store.scope(\\.path, action: \\.path)) {\n  // Root view\n} destination: { store in\n  switch store.case {\n  case let .add(store):\n    AddView(store: store)\n  case let .detail(store):\n    DetailView(store: store)\n  case let .edit(store):\n    EditView(store: store)\n  }\n}\n```\n\n#### Navigating to non-reducer features\n\nThere are many times that you want to present or navigate to a feature that is not modeled with a\nComposable Architecture reducer. This can happen with legacy features that are not built with the\nComposable Architecture, or with features that are very simple and do not need a fully built\nreducer.\n\nIn those cases you can use the ``ReducerCaseIgnored()`` and ``ReducerCaseEphemeral()`` macros to\nannotate cases that are not powered by reducers. See the documentation for those macros for more\ndetails.\n\nAs an example, suppose that you have a feature that can navigate to multiple features, all of \nwhich are Composable Architecture features except for one:\n\n```swift\n@Reducer\nenum Destination {\n  case add(AddItemFeature)\n  case edit(EditItemFeature)\n  @ReducerCaseIgnored\n  case item(Item)\n}\n```\n\nIn this situation the `.item` case holds onto a plain item and not a full reducer, and for that \nreason we have to ignore it from some of `@Reducer`'s macro expansion.\n\nThen, to present a view from this case one can do:\n\n```swift\n.sheet(item: $store.scope(\\.destination?.item, action: \\.destination.item)) { store in\n  ItemView(item: store.withState { $0 })\n}\n```\n\n> Note: The ``Store/withState(_:)`` is necessary because the value held inside the `.item` case\ndoes not have the ``ObservableState()`` macro applied, nor should it. And so using `withState`\nis a way to get access to the state in the store without any observation taking place.\n\n#### Synthesizing protocol conformances on State and Action\n\nSince the `State` and `Action` types are generated automatically for you when using `@Reducer` on an\nenum, you must extend these types yourself to synthesize conformances of `Equatable`, `Hashable`,\n_etc._:\n\n```swift\n@Reducer\nenum Destination {\n  // ...\n}\nextension Destination.State: Equatable {}\n```\n\n> Note: In Swift <6 the above extension causes a compiler error due to a bug in Swift.\n>\n> To work around this compiler bug, the library provides a version of the `@Reducer` macro that\n> takes two ``ComposableArchitecture/_SynthesizedConformance`` arguments, which allow you to\n> describe the protocols you want to attach to the `State` or `Action` types:\n>\n> ```swift\n> @Reducer(state: .equatable, .sendable, action: .sendable)\n> enum Destination {\n>   // ...\n> }\n> ```\n\n#### Nested enum reducers\n\nThere may be times when an enum reducer may want to nest another enum reducer. To do so, the parent\nenum reducer must specify the child's `Body` associated value and `body` static property explicitly:\n\n```swift\n@Reducer\nenum Modal { /* ... */ }\n\n@Reducer\nenum Destination {\n  case modal(Modal.Body = Modal.body)\n}\n```\n\n### Gotchas\n\n#### Autocomplete\n\nApplying `@Reducer` can break autocompletion in the `body` of the reducer. This is a known\n[issue](https://github.com/apple/swift/issues/69477), and it can generally be worked around by\nproviding additional type hints to the compiler:\n\n 1. Adding an explicit `Reducer` conformance in addition to the macro application can restore\n    autocomplete throughout the `body` of the reducer:\n\n    ```diff\n     @Reducer\n    -struct Feature {\n    +struct Feature: Reducer {\n    ```\n\n 2. Adding explicit generics to instances of `Reduce` in the `body` can restore autocomplete\n    inside the `Reduce`:\n\n    ```diff\n     var body: some Reducer<State, Action> {\n    -  Reduce { state, action in\n    +  Reduce<State, Action> { state, action in\n    ```\n\n#### #Preview and enum reducers\n\nThe `#Preview` macro is not capable of seeing the expansion of any macros since it is a macro \nitself. This means that when using destination and path reducers (see\n<doc:Reducer#Destination-and-path-reducers> above) you cannot construct the cases of the state \nenum inside `#Preview`:\n\n```swift\n#Preview {\n  FeatureView(\n    store: Store(\n      initialState: Feature.State(\n        destination: .edit(EditFeature.State())  // 🛑\n      )\n    ) {\n      Feature()\n    }\n  )\n}\n```\n\nThe `.edit` case is not usable from within `#Preview` since it is generated by the ``Reducer()``\nmacro.\n\nThe workaround is to move the view to a helper that be compiled outside of a macro, and then use it\ninside the macro:\n\n```swift\n#Preview {\n  preview\n}\nprivate var preview: some View {\n  FeatureView(\n    store: Store(\n      initialState: Feature.State(\n        destination: .edit(EditFeature.State())\n      )\n    ) {\n      Feature()\n    }\n  )\n}\n```\n\nYou can use a computed property, free function, or even a dedicated view if you want. You can also\nuse the old, non-macro style of previews by using a `PreviewProvider`:\n\n```swift\nstruct Feature_Previews: PreviewProvider {\n  static var previews: some  View {\n    FeatureView(\n      store: Store(\n        initialState: Feature.State(\n          destination: .edit(EditFeature.State())\n        )\n      ) {\n        Feature()\n      }\n    )\n  }\n}\n```\n\n#### Error: External macro implementation … could not be found\n\nWhen integrating with the Composable Architecture, one may encounter the following error:\n\n> Error: External macro implementation type 'ComposableArchitectureMacros.ReducerMacro' could not be\n> found for macro 'Reducer()'\n\nThis error can show up when the macro has not yet been enabled, which is a separate error that\nshould be visible from Xcode's Issue navigator.\n\nSometimes, however, this error will still emit due to an Xcode bug in which a custom build\nconfiguration name is being used in the project. In general, using a build configuration other than\n\"Debug\" or \"Release\" can trigger upstream build issues with Swift packages, and we recommend only\nusing the default \"Debug\" and \"Release\" build configuration names to avoid the above issue and\nothers.\n\n#### CI build failures\n\nWhen testing your code on an external CI server you may run into errors such as the following:\n\n> Error: CasePathsMacros Target 'CasePathsMacros' must be enabled before it can be used.\n>\n> ComposableArchitectureMacros Target 'ComposableArchitectureMacros' must be enabled before it can\n> be used.\n\nYou can fix this in one of two ways. You can write a default to the CI machine that allows Xcode to\nskip macro validation:\n\n```shell\ndefaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES\n```\n\nOr if you are invoking `xcodebuild` directly in your CI scripts, you can pass the\n`-skipMacroValidation` flag to `xcodebuild` when building your project:\n\n```shell\nxcodebuild -skipMacroValidation …\n```\n\n[casepathable-docs]: https://swiftpackageindex.com/pointfreeco/swift-case-paths/main/documentation/casepaths/casepathable()\n[casepaths-gh]: http://github.com/pointfreeco/swift-case-paths\n\n\n## Topics\n\n### Implementing a reducer\n\n- ``Reducer()``\n- ``State``\n- ``Action``\n- ``body-swift.property``\n- ``Reduce``\n- ``Effect``\n\n### Composing reducers\n\n- ``ReducerBuilder``\n- ``CombineReducers``\n\n### Embedding child features\n\n- ``Scope``\n- ``ifLet(_:action:then:fileID:filePath:line:column:)-2r2pn``\n- ``ifCaseLet(_:action:then:fileID:filePath:line:column:)-7sg8d``\n- ``forEach(_:action:element:fileID:filePath:line:column:)-6zye8``\n- <doc:Navigation>\n\n### Supporting reducers\n\n- ``EmptyReducer``\n- ``BindingReducer``\n- ``Swift/Optional``\n\n### Reducer modifiers\n\n- ``dependency(_:_:)``\n- ``transformDependency(_:transform:)``\n- ``onChange(of:_:)``\n- ``signpost(_:log:)``\n- ``_printChanges(_:)``\n\n### Supporting types\n\n- ``ReducerOf``\n\n### Deprecations\n\n- <doc:ReducerDeprecations>\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBody.md":"# ``ComposableArchitecture/Reducer/body-swift.property``\n\n## Topics\n\n### Associated type\n\n- ``Body``\n","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md)","Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md)"},"items":[{"name":"Action.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Action.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Action.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/Reducer/Action``\n\n## Topics\n\n### View actions\n\n- ``ViewAction``\n- ``ViewAction(for:)``\n- ``ViewActionSending``\n","isInternal":false,"tokens":36,"sizeBytes":138},{"name":"EffectDeprecations.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md","title":"Deprecations Skill","category":"anthropic-skill","format":"markdown","content":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md)","tokens":300,"sizeBytes":333},{"name":"ReducerDeprecations.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md","title":"Deprecations Skill","category":"anthropic-skill","format":"markdown","content":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md)","tokens":300,"sizeBytes":335},{"name":"ScopeDeprecations.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md","title":"Deprecations Skill","category":"anthropic-skill","format":"markdown","content":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md)","tokens":300,"sizeBytes":331},{"name":"StoreDeprecations.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md","title":"Deprecations Skill","category":"anthropic-skill","format":"markdown","content":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md)","tokens":300,"sizeBytes":331},{"name":"SwiftUIDeprecations.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md","title":"Deprecations Skill","category":"anthropic-skill","format":"markdown","content":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md)","tokens":300,"sizeBytes":335},{"name":"TestStoreDeprecations.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md","title":"Deprecations Skill","category":"anthropic-skill","format":"markdown","content":"# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md)","tokens":300,"sizeBytes":339},{"name":"Effect.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Effect.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Effect.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/Effect``\n\n## Topics\n\n### Creating an effect\n\n- ``none``\n- ``run(priority:operation:catch:fileID:filePath:line:column:)``\n- ``send(_:)``\n- ``EffectOf``\n\n### Cancellation\n\n- ``cancellable(id:cancelInFlight:)``\n- ``cancel(id:)``\n- ``ComposableArchitecture/withTaskCancellation(id:cancelInFlight:isolation:operation:)``\n- ``_Concurrency/Task/cancel(id:)``\n\n### Composition\n\n- ``map(_:)``\n- ``merge(_:)-5ai73``\n- ``merge(_:)-8ckqn``\n- ``merge(with:)``\n- ``concatenate(_:)-3iza9``\n- ``concatenate(_:)-4gba2``\n- ``concatenate(with:)``\n\n### SwiftUI integration\n\n- ``animation(_:)``\n- ``transaction(_:)``\n\n### Combine integration\n\n- ``publisher(_:)``\n- ``debounce(id:for:scheduler:options:)``\n- ``throttle(id:for:scheduler:latest:)``\n\n### Deprecations\n\n- <doc:EffectDeprecations>\n","isInternal":false,"tokens":235,"sizeBytes":798},{"name":"EffectRun.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectRun.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectRun.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/Effect/run(priority:operation:catch:fileID:filePath:line:column:)``\n\n## Topics\n\n### Sending actions\n\n- ``Send``\n","isInternal":false,"tokens":36,"sizeBytes":139},{"name":"EffectSend.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectSend.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectSend.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/Effect/send(_:)``\n\n## Topics\n\n### Animating actions\n\n- ``Effect/send(_:animation:)``\n","isInternal":false,"tokens":28,"sizeBytes":112},{"name":"IdentifiedAction.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/IdentifiedAction.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/IdentifiedAction.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/IdentifiedAction``\n\n## Topics\n\n### Supporting types\n\n- ``IdentifiedActionOf``\n","isInternal":false,"tokens":25,"sizeBytes":105},{"name":"NavigationLinkState.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/NavigationLinkState.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/NavigationLinkState.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``SwiftUI/NavigationLink/init(state:label:fileID:filePath:line:column:)``\n\n## Topics\n\n### Overloads\n\n- ``SwiftUI/NavigationLink/init(_:state:fileID:line:)-1fmz8``\n- ``SwiftUI/NavigationLink/init(_:state:fileID:line:)-3xjq3``\n","isInternal":false,"tokens":74,"sizeBytes":227},{"name":"ObservableState.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/ObservableState.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ObservableState.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/ObservableState()``\n\n## Topics\n\n### Conformance\n\n- ``ObservableState``\n\n### Change tracking\n\n- ``ObservableStateID``\n- ``ObservationStateRegistrar``\n\n### Supporting macros\n\n- ``ObservationStateTracked()``\n- ``ObservationStateIgnored()``\n","isInternal":false,"tokens":63,"sizeBytes":264},{"name":"Presents.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Presents.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Presents.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/Presents()``\n\n## Topics\n\n### Property wrapper\n\n- ``PresentationState``\n","isInternal":false,"tokens":22,"sizeBytes":98},{"name":"Reduce.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Reduce.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Reduce.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/Reduce``\n\n## Topics\n\n### Creating a reducer\n\n- ``init(_:)-6xl6k``\n\n### Type erased reducers\n\n- ``init(_:)-9kwa6``\n\n### Reduce conformance\n\n- ``Reducer/body-20w8t``\n- ``Reducer/reduce(into:action:)-1t2ri``\n","isInternal":false,"tokens":75,"sizeBytes":232},{"name":"Reducer.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Reducer.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Reducer.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/Reducer``\n\nThe ``Reducer`` protocol describes how to evolve the current state of an application to the next\nstate, given an action, and describes what ``Effect``s should be executed later by the store, if\nany. Types that conform to this protocol represent the domain, logic and behavior for a feature.\nConformances to ``Reducer`` can be written by hand, but the ``Reducer()`` can make your reducers \nmore concise and more powerful.\n\n* [Conforming to the Reducer protocol](#Conforming-to-the-Reducer-protocol)\n* [Using the @Reducer macro](#Using-the-Reducer-macro)\n  * [@CasePathable and @dynamicMemberLookup enums](#CasePathable-and-dynamicMemberLookup-enums)\n  * [Automatic fulfillment of reducer requirements](#Automatic-fulfillment-of-reducer-requirements)\n  * [Destination and path reducers](#Destination-and-path-reducers)\n    * [Navigating to non-reducer features](#Navigating-to-non-reducer-features)\n    * [Synthesizing protocol conformances on State and Action](#Synthesizing-protocol-conformances-on-State-and-Action)\n    * [Nested enum reducers](#Nested-enum-reducers)\n  * [Gotchas](#Gotchas)\n    * [Autocomplete](#Autocomplete)\n    * [#Preview and enum reducers](#Preview-and-enum-reducers)\n    * [CI build failures](#CI-build-failures)\n\n## Conforming to the Reducer protocol\n\nThe bare minimum of conforming to the ``Reducer`` protocol is to provide a ``Reducer/State`` type\nthat represents the state your feature needs to do its job, a ``Reducer/Action`` type that\nrepresents the actions users can perform in your feature (as well as actions that effects can\nfeed back into the system), and a ``Reducer/body-20w8t`` property that compose your feature\ntogether with any other features that are needed (such as for navigation).\n\nAs a very simple example, a \"counter\" feature could model its state as a struct holding an integer:\n\n```swift\nstruct CounterFeature: Reducer {\n  @ObservableState\n  struct State {\n    var count = 0\n  }\n}\n```\n\n> Note: We have added the ``ObservableState()`` to `State` here so that the view can automatically\n> observe state changes. In future versions of the library this macro will be automatically applied\n> by the ``Reducer()`` macro.\n\nThe actions would be just two cases for tapping an increment or decrement button:\n\n```swift\nstruct CounterFeature: Reducer {\n  // ...\n  enum Action {\n    case decrementButtonTapped\n    case incrementButtonTapped\n  }\n}\n```\n\nThe logic of your feature is implemented by mutating the feature's current state when an action\ncomes into the system. This is most easily done by constructing a ``Reduce`` inside the\n``Reducer/body-20w8t`` of your reducer:\n\n```swift\nstruct CounterFeature: Reducer {\n  // ...\n  var body: some ReducerOf<Self> {\n    Reduce { state, action in\n      switch action {\n      case .decrementButtonTapped:\n        state.count -= 1\n        return .none\n      case .incrementButtonTapped:\n        state.count += 1  \n        return .none\n      }\n    }\n  }\n}\n```\n\nThe ``Reduce`` reducer's first responsibility is to mutate the feature's current state given an\naction. Its second responsibility is to return effects that will be executed asynchronously and feed\ntheir data back into the system. Currently `Feature` does not need to run any effects, and so\n``Effect/none`` is returned.\n\nIf the feature does need to do effectful work, then more would need to be done. For example, suppose\nthe feature has the ability to start and stop a timer, and with each tick of the timer the `count`\nwill be incremented. That could be done like so:\n\n```swift\nstruct CounterFeature: Reducer {\n  @ObservableState\n  struct State {\n    var count = 0\n  }\n  enum Action {\n    case decrementButtonTapped\n    case incrementButtonTapped\n    case startTimerButtonTapped\n    case stopTimerButtonTapped\n    case timerTick\n  }\n  enum CancelID { case timer }\n\n  var body: some ReducerOf<Self> {\n    Reduce { state, action in\n      switch action {\n      case .decrementButtonTapped:\n        state.count -= 1\n        return .none\n\n      case .incrementButtonTapped:\n        state.count += 1\n        return .none\n\n      case .startTimerButtonTapped:\n        return .run { send in\n          while true {\n            try await Task.sleep(for: .seconds(1))\n            await send(.timerTick)\n          }\n        }\n        .cancellable(CancelID.timer)\n\n      case .stopTimerButtonTapped:\n        return .cancel(CancelID.timer)\n\n      case .timerTick:\n        state.count += 1\n        return .none\n      }\n    }\n  }\n}\n```\n\n> Note: This sample emulates a timer by performing an infinite loop with a `Task.sleep` inside. This\n> is simple to do, but is also inaccurate since small imprecisions can accumulate. It would be\n> better to inject a clock into the feature so that you could use its `timer` method. Read the\n> <doc:DependencyManagement> and <doc:TestingTCA> articles for more information.\n\nThat is the basics of implementing a feature as a conformance to ``Reducer``. \n\n## Using the @Reducer macro\n\nWhile you technically can conform to the ``Reducer`` protocol directly, as we did above, the\n``Reducer()`` macro can automate many aspects of implementing features for you. At a bare minimum,\nall you have to do is annotate your reducer with `@Reducer` and you can even drop the `Reducer`\nconformance:\n\n```diff\n+@Reducer\n-struct CounterFeature: Reducer {\n+struct CounterFeature {\n   @ObservableState\n   struct State {\n     var count = 0\n   }\n   enum Action {\n     case decrementButtonTapped\n     case incrementButtonTapped\n   }\n   var body: some ReducerOf<Self> {\n     Reduce { state, action in\n       switch action {\n       case .decrementButtonTapped:\n         state.count -= 1\n         return .none\n       case .incrementButtonTapped:\n         state.count += 1  \n         return .none\n       }\n     }\n   }\n }\n```\n\nThere are a number of things the ``Reducer()`` macro does for you:\n\n### @CasePathable and @dynamicMemberLookup enums\n\nThe `@Reducer` macro automatically applies the [`@CasePathable`][casepathable-docs] macro to your\n`Action` enum:\n\n```diff\n+@CasePathable\n enum Action {\n   // ...\n }\n```\n\n[Case paths][casepaths-gh] are a tool that bring the power and ergonomics of key paths to enum\ncases, and they are a vital tool for composing reducers together.\n\nIn particular, having this macro applied to your `Action` enum will allow you to use key path\nsyntax for specifying enum cases in various APIs in the library, such as\n``Reducer/ifLet(_:action:destination:fileID:filePath:line:column:)-4ub6q``,\n``Reducer/forEach(_:action:destination:fileID:filePath:line:column:)-9svqb``, ``Scope``, and more.\n\nFurther, if the ``Reducer/State`` of your feature is an enum, which is useful for modeling a feature\nthat can be one of multiple mutually exclusive values, the ``Reducer()`` will apply the\n`@CasePathable` macro, as well as `@dynamicMemberLookup`:\n\n```diff\n+@CasePathable\n+@dynamicMemberLookup\n enum State {\n   // ...\n }\n```\n\nThis will allow you to use key path syntax for specifying case paths to the `State`'s cases, as well\nas allow you to use dot-chaining syntax for optionally extracting a case from the state. This can be\nuseful when using the operators that come with the library that allow for driving navigation from an\nenum of options:\n\n```swift\n.sheet(\n  item: $store.scope(\\.destination?.editForm, action: \\.destination.editForm)\n) { store in\n  FormView(store: store)\n}\n```\n\nThe syntax `\\.destination?.editForm` is only possible due to both `@dynamicMemberLookup` and\n`@CasePathable` being applied to the `State` enum.\n\n### Automatic fulfillment of reducer requirements\n\nThe ``Reducer()`` macro will automatically fill in any ``Reducer`` protocol requirements that you\nleave off. For example, something as simple as this compiles:\n\n```swift\n@Reducer\nstruct Feature {}\n```\n\nThe `@Reducer` macro will automatically insert an empty ``Reducer/State`` struct, an empty\n``Reducer/Action`` enum, and an empty ``Reducer/body-swift.property``. This effectively means that\n`Feature` is a logicless, behaviorless, inert reducer.\n\nHaving these requirements automatically fulfilled for you can be handy for slowly filling them in\nwith their real implementations. For example, this `Feature` reducer could be integrated in a parent\ndomain using the library's navigation tools, all without having implemented any of the domain yet.\nThen, once we are ready we can start implementing the real logic and behavior of the feature.\n\n### Destination and path reducers\n\nThere is a common pattern in the Composable Architecture of representing destinations a feature can\nnavigate to as a reducer that operates on enum state, with a case for each feature that can be\nnavigated to. This is explained in great detail in the <doc:TreeBasedNavigation> and\n<doc:StackBasedNavigation> articles.\n\nThis form of domain modeling can be very powerful, but also incur a bit of boilerplate. For example,\nif a feature can navigate to 3 other features, then one might have a `Destination` reducer like the\nfollowing:\n\n```swift\n@Reducer\nstruct Destination {\n  @ObservableState\n  enum State {\n    case add(FormFeature.State)\n    case detail(DetailFeature.State)\n    case edit(EditFeature.State)\n  }\n  enum Action {\n    case add(FormFeature.Action)\n    case detail(DetailFeature.Action)\n    case edit(EditFeature.Action)\n  }\n  var body: some ReducerOf<Self> {\n    Scope(\\.add, action: \\.add) {\n      FormFeature()\n    }\n    Scope(\\.detail, action: \\.detail) {\n      DetailFeature()\n    }\n    Scope(\\.edit, action: \\.edit) {\n      EditFeature()\n    }\n  }\n}\n```\n\nIt's not the worst code in the world, but it is 24 lines with a lot of repetition, and if we need to\nadd a new destination we must add a case to the ``Reducer/State`` enum, a case to the\n``Reducer/Action`` enum, and a ``Scope`` to the ``Reducer/body-swift.property``.\n\nThe ``Reducer()`` macro is now capable of generating all of this code for you from the following\nsimple declaration\n\n```swift\n@Reducer\nenum Destination {\n  case add(FormFeature)\n  case detail(DetailFeature)\n  case edit(EditFeature)\n}\n```\n\n24 lines of code has become 6. The `@Reducer` macro can now be applied to an _enum_ where each case\nholds onto the reducer that governs the logic and behavior for that case. Further, when using the\n``Reducer/ifLet(_:action:)`` operator with this style of `Destination` enum reducer you can\ncompletely leave off the trailing closure as it can be automatically inferred:\n\n```diff\n Reduce { state, action in\n   // Core feature logic\n }\n .ifLet(\\.$destination, action: \\.destination)\n-{\n-  Destination()\n-}\n```\n\nThis pattern also works for `Path` reducers, which is common when dealing with\n<doc:StackBasedNavigation>, and in that case you can leave off the trailing closure of the\n``Reducer/forEach(_:action:)`` operator:\n\n```diff\nReduce { state, action in\n  // Core feature logic\n}\n.forEach(\\.path, action: \\.path)\n-{\n-  Path()\n-}\n```\n\nFurther, for `Path` reducers in particular, the ``Reducer()`` macro also helps you reduce\nboilerplate when using the initializer \n``SwiftUI/NavigationStack/init(path:root:destination:fileID:filePath:line:column:)`` that comes with the library. \nIn the last trailing closure you can use the ``Store/case`` computed property to switch on the \n`Path.State` enum and extract out a store for each case:\n\n```swift\nNavigationStack(path: $store.scope(\\.path, action: \\.path)) {\n  // Root view\n} destination: { store in\n  switch store.case {\n  case let .add(store):\n    AddView(store: store)\n  case let .detail(store):\n    DetailView(store: store)\n  case let .edit(store):\n    EditView(store: store)\n  }\n}\n```\n\n#### Navigating to non-reducer features\n\nThere are many times that you want to present or navigate to a feature that is not modeled with a\nComposable Architecture reducer. This can happen with legacy features that are not built with the\nComposable Architecture, or with features that are very simple and do not need a fully built\nreducer.\n\nIn those cases you can use the ``ReducerCaseIgnored()`` and ``ReducerCaseEphemeral()`` macros to\nannotate cases that are not powered by reducers. See the documentation for those macros for more\ndetails.\n\nAs an example, suppose that you have a feature that can navigate to multiple features, all of \nwhich are Composable Architecture features except for one:\n\n```swift\n@Reducer\nenum Destination {\n  case add(AddItemFeature)\n  case edit(EditItemFeature)\n  @ReducerCaseIgnored\n  case item(Item)\n}\n```\n\nIn this situation the `.item` case holds onto a plain item and not a full reducer, and for that \nreason we have to ignore it from some of `@Reducer`'s macro expansion.\n\nThen, to present a view from this case one can do:\n\n```swift\n.sheet(item: $store.scope(\\.destination?.item, action: \\.destination.item)) { store in\n  ItemView(item: store.withState { $0 })\n}\n```\n\n> Note: The ``Store/withState(_:)`` is necessary because the value held inside the `.item` case\ndoes not have the ``ObservableState()`` macro applied, nor should it. And so using `withState`\nis a way to get access to the state in the store without any observation taking place.\n\n#### Synthesizing protocol conformances on State and Action\n\nSince the `State` and `Action` types are generated automatically for you when using `@Reducer` on an\nenum, you must extend these types yourself to synthesize conformances of `Equatable`, `Hashable`,\n_etc._:\n\n```swift\n@Reducer\nenum Destination {\n  // ...\n}\nextension Destination.State: Equatable {}\n```\n\n> Note: In Swift <6 the above extension causes a compiler error due to a bug in Swift.\n>\n> To work around this compiler bug, the library provides a version of the `@Reducer` macro that\n> takes two ``ComposableArchitecture/_SynthesizedConformance`` arguments, which allow you to\n> describe the protocols you want to attach to the `State` or `Action` types:\n>\n> ```swift\n> @Reducer(state: .equatable, .sendable, action: .sendable)\n> enum Destination {\n>   // ...\n> }\n> ```\n\n#### Nested enum reducers\n\nThere may be times when an enum reducer may want to nest another enum reducer. To do so, the parent\nenum reducer must specify the child's `Body` associated value and `body` static property explicitly:\n\n```swift\n@Reducer\nenum Modal { /* ... */ }\n\n@Reducer\nenum Destination {\n  case modal(Modal.Body = Modal.body)\n}\n```\n\n### Gotchas\n\n#### Autocomplete\n\nApplying `@Reducer` can break autocompletion in the `body` of the reducer. This is a known\n[issue](https://github.com/apple/swift/issues/69477), and it can generally be worked around by\nproviding additional type hints to the compiler:\n\n 1. Adding an explicit `Reducer` conformance in addition to the macro application can restore\n    autocomplete throughout the `body` of the reducer:\n\n    ```diff\n     @Reducer\n    -struct Feature {\n    +struct Feature: Reducer {\n    ```\n\n 2. Adding explicit generics to instances of `Reduce` in the `body` can restore autocomplete\n    inside the `Reduce`:\n\n    ```diff\n     var body: some Reducer<State, Action> {\n    -  Reduce { state, action in\n    +  Reduce<State, Action> { state, action in\n    ```\n\n#### #Preview and enum reducers\n\nThe `#Preview` macro is not capable of seeing the expansion of any macros since it is a macro \nitself. This means that when using destination and path reducers (see\n<doc:Reducer#Destination-and-path-reducers> above) you cannot construct the cases of the state \nenum inside `#Preview`:\n\n```swift\n#Preview {\n  FeatureView(\n    store: Store(\n      initialState: Feature.State(\n        destination: .edit(EditFeature.State())  // 🛑\n      )\n    ) {\n      Feature()\n    }\n  )\n}\n```\n\nThe `.edit` case is not usable from within `#Preview` since it is generated by the ``Reducer()``\nmacro.\n\nThe workaround is to move the view to a helper that be compiled outside of a macro, and then use it\ninside the macro:\n\n```swift\n#Preview {\n  preview\n}\nprivate var preview: some View {\n  FeatureView(\n    store: Store(\n      initialState: Feature.State(\n        destination: .edit(EditFeature.State())\n      )\n    ) {\n      Feature()\n    }\n  )\n}\n```\n\nYou can use a computed property, free function, or even a dedicated view if you want. You can also\nuse the old, non-macro style of previews by using a `PreviewProvider`:\n\n```swift\nstruct Feature_Previews: PreviewProvider {\n  static var previews: some  View {\n    FeatureView(\n      store: Store(\n        initialState: Feature.State(\n          destination: .edit(EditFeature.State())\n        )\n      ) {\n        Feature()\n      }\n    )\n  }\n}\n```\n\n#### Error: External macro implementation … could not be found\n\nWhen integrating with the Composable Architecture, one may encounter the following error:\n\n> Error: External macro implementation type 'ComposableArchitectureMacros.ReducerMacro' could not be\n> found for macro 'Reducer()'\n\nThis error can show up when the macro has not yet been enabled, which is a separate error that\nshould be visible from Xcode's Issue navigator.\n\nSometimes, however, this error will still emit due to an Xcode bug in which a custom build\nconfiguration name is being used in the project. In general, using a build configuration other than\n\"Debug\" or \"Release\" can trigger upstream build issues with Swift packages, and we recommend only\nusing the default \"Debug\" and \"Release\" build configuration names to avoid the above issue and\nothers.\n\n#### CI build failures\n\nWhen testing your code on an external CI server you may run into errors such as the following:\n\n> Error: CasePathsMacros Target 'CasePathsMacros' must be enabled before it can be used.\n>\n> ComposableArchitectureMacros Target 'ComposableArchitectureMacros' must be enabled before it can\n> be used.\n\nYou can fix this in one of two ways. You can write a default to the CI machine that allows Xcode to\nskip macro validation:\n\n```shell\ndefaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES\n```\n\nOr if you are invoking `xcodebuild` directly in your CI scripts, you can pass the\n`-skipMacroValidation` flag to `xcodebuild` when building your project:\n\n```shell\nxcodebuild -skipMacroValidation …\n```\n\n[casepathable-docs]: https://swiftpackageindex.com/pointfreeco/swift-case-paths/main/documentation/casepaths/casepathable()\n[casepaths-gh]: http://github.com/pointfreeco/swift-case-paths\n\n\n## Topics\n\n### Implementing a reducer\n\n- ``Reducer()``\n- ``State``\n- ``Action``\n- ``body-swift.property``\n- ``Reduce``\n- ``Effect``\n\n### Composing reducers\n\n- ``ReducerBuilder``\n- ``CombineReducers``\n\n### Embedding child features\n\n- ``Scope``\n- ``ifLet(_:action:then:fileID:filePath:line:column:)-2r2pn``\n- ``ifCaseLet(_:action:then:fileID:filePath:line:column:)-7sg8d``\n- ``forEach(_:action:element:fileID:filePath:line:column:)-6zye8``\n- <doc:Navigation>\n\n### Supporting reducers\n\n- ``EmptyReducer``\n- ``BindingReducer``\n- ``Swift/Optional``\n\n### Reducer modifiers\n\n- ``dependency(_:_:)``\n- ``transformDependency(_:transform:)``\n- ``onChange(of:_:)``\n- ``signpost(_:log:)``\n- ``_printChanges(_:)``\n\n### Supporting types\n\n- ``ReducerOf``\n\n### Deprecations\n\n- <doc:ReducerDeprecations>\n","isInternal":false,"tokens":4582,"sizeBytes":18961},{"name":"ReducerBody.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBody.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBody.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/Reducer/body-swift.property``\n\n## Topics\n\n### Associated type\n\n- ``Body``\n","isInternal":false,"tokens":24,"sizeBytes":101},{"name":"ReducerBuilder.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBuilder.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBuilder.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# ``ComposableArchitecture/ReducerBuilder``\n\n## Topics\n\n### Building reducers\n\n- ``buildExpression(_:)-cp3q``\n- ``buildExpression(_:)-9uxku``\n- ``buildBlock(_:)``\n- ``buildBlock()``\n- ``buildPartialBlock(first:)``\n- ``buildPartialBlock(accumulated:next:)``\n- ``buildOptional(_:)``\n- ``buildEither(first:)``\n- ``buildEither(second:)``\n- ``buildArray(_:)``\n- ``buildLimitedAvailability(_:)``\n- ``buildFinalResult(_:)``\n","isInternal":false,"tokens":114,"sizeBytes":417},{"name":"ReducerForEach.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md)","tokens":300,"sizeBytes":297},{"name":"ReducerlIfLet.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md)","tokens":300,"sizeBytes":295},{"name":"ReducerlIfLetPresentation.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md)","tokens":300,"sizeBytes":319},{"name":"ReducerMacro.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md)","tokens":300,"sizeBytes":293},{"name":"Scope.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md)","tokens":300,"sizeBytes":279},{"name":"State.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md)","tokens":300,"sizeBytes":279},{"name":"Store.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md)","tokens":300,"sizeBytes":279},{"name":"StoreDynamicMemberLookup.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md)","tokens":300,"sizeBytes":317},{"name":"StoreState.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md)","tokens":300,"sizeBytes":289},{"name":"SwiftUIBinding.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md)","tokens":300,"sizeBytes":297},{"name":"SwiftUIBindingScopeForEach.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md)","tokens":300,"sizeBytes":321},{"name":"SwiftUIBindingScopeIfLet.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md)","tokens":300,"sizeBytes":317},{"name":"SwiftUIBindingSubscript.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingSubscript.md)","tokens":300,"sizeBytes":315},{"name":"SwiftUIIntegration.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIIntegration.md)","tokens":300,"sizeBytes":305},{"name":"SwitchStore.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwitchStore.md)","tokens":300,"sizeBytes":291},{"name":"TestStore.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStore.md)","tokens":300,"sizeBytes":287},{"name":"TestStoreDependencies.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreDependencies.md)","tokens":300,"sizeBytes":311},{"name":"TestStoreExhaustivity.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/TestStoreExhaustivity.md)","tokens":300,"sizeBytes":311},{"name":"UIKit.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/UIKit.md)","tokens":300,"sizeBytes":279},{"name":"ViewStore.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStore.md)","tokens":300,"sizeBytes":287},{"name":"ViewStoreBinding.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ViewStoreBinding.md)","tokens":300,"sizeBytes":301},{"name":"WithViewStore.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStore.md)","tokens":300,"sizeBytes":295},{"name":"WithViewStoreInit.md","path":"Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md","rawUrl":"https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md","title":"Extensions Skill","category":"anthropic-skill","format":"markdown","content":"# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/WithViewStoreInit.md)","tokens":300,"sizeBytes":303}],"systemPromptSnippet":"<yakaai_skills repo=\"pointfreeco/swift-composable-architecture\">\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Action.md (Tokens: ~36 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/Reducer/Action``\n\n## Topics\n\n### View actions\n\n- ``ViewAction``\n- ``ViewAction(for:)``\n- ``ViewActionSending``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/EffectDeprecations.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ReducerDeprecations.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/ScopeDeprecations.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/StoreDeprecations.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/SwiftUIDeprecations.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Deprecations Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Deprecations/TestStoreDeprecations.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Effect.md (Tokens: ~235 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/Effect``\n\n## Topics\n\n### Creating an effect\n\n- ``none``\n- ``run(priority:operation:catch:fileID:filePath:line:column:)``\n- ``send(_:)``\n- ``EffectOf``\n\n### Cancellation\n\n- ``cancellable(id:cancelInFlight:)``\n- ``cancel(id:)``\n- ``ComposableArchitecture/withTaskCancellation(id:cancelInFlight:isolation:operation:)``\n- ``_Concurrency/Task/cancel(id:)``\n\n### Composition\n\n- ``map(_:)``\n- ``merge(_:)-5ai73``\n- ``merge(_:)-8ckqn``\n- ``merge(with:)``\n- ``concatenate(_:)-3iza9``\n- ``concatenate(_:)-4gba2``\n- ``concatenate(with:)``\n\n### SwiftUI integration\n\n- ``animation(_:)``\n- ``transaction(_:)``\n\n### Combine integration\n\n- ``publisher(_:)``\n- ``debounce(id:for:scheduler:options:)``\n- ``throttle(id:for:scheduler:latest:)``\n\n### Deprecations\n\n- <doc:EffectDeprecations>\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectRun.md (Tokens: ~36 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/Effect/run(priority:operation:catch:fileID:filePath:line:column:)``\n\n## Topics\n\n### Sending actions\n\n- ``Send``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/EffectSend.md (Tokens: ~28 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/Effect/send(_:)``\n\n## Topics\n\n### Animating actions\n\n- ``Effect/send(_:animation:)``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/IdentifiedAction.md (Tokens: ~25 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/IdentifiedAction``\n\n## Topics\n\n### Supporting types\n\n- ``IdentifiedActionOf``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/NavigationLinkState.md (Tokens: ~74 | Category: anthropic-skill) -->\n# ``SwiftUI/NavigationLink/init(state:label:fileID:filePath:line:column:)``\n\n## Topics\n\n### Overloads\n\n- ``SwiftUI/NavigationLink/init(_:state:fileID:line:)-1fmz8``\n- ``SwiftUI/NavigationLink/init(_:state:fileID:line:)-3xjq3``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/ObservableState.md (Tokens: ~63 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/ObservableState()``\n\n## Topics\n\n### Conformance\n\n- ``ObservableState``\n\n### Change tracking\n\n- ``ObservableStateID``\n- ``ObservationStateRegistrar``\n\n### Supporting macros\n\n- ``ObservationStateTracked()``\n- ``ObservationStateIgnored()``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Presents.md (Tokens: ~22 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/Presents()``\n\n## Topics\n\n### Property wrapper\n\n- ``PresentationState``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Reduce.md (Tokens: ~75 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/Reduce``\n\n## Topics\n\n### Creating a reducer\n\n- ``init(_:)-6xl6k``\n\n### Type erased reducers\n\n- ``init(_:)-9kwa6``\n\n### Reduce conformance\n\n- ``Reducer/body-20w8t``\n- ``Reducer/reduce(into:action:)-1t2ri``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Reducer.md (Tokens: ~4582 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/Reducer``\n\nThe ``Reducer`` protocol describes how to evolve the current state of an application to the next\nstate, given an action, and describes what ``Effect``s should be executed later by the store, if\nany. Types that conform to this protocol represent the domain, logic and behavior for a feature.\nConformances to ``Reducer`` can be written by hand, but the ``Reducer()`` can make your reducers \nmore concise and more powerful.\n\n* [Conforming to the Reducer protocol](#Conforming-to-the-Reducer-protocol)\n* [Using the @Reducer macro](#Using-the-Reducer-macro)\n  * [@CasePathable and @dynamicMemberLookup enums](#CasePathable-and-dynamicMemberLookup-enums)\n  * [Automatic fulfillment of reducer requirements](#Automatic-fulfillment-of-reducer-requirements)\n  * [Destination and path reducers](#Destination-and-path-reducers)\n    * [Navigating to non-reducer features](#Navigating-to-non-reducer-features)\n    * [Synthesizing protocol conformances on State and Action](#Synthesizing-protocol-conformances-on-State-and-Action)\n    * [Nested enum reducers](#Nested-enum-reducers)\n  * [Gotchas](#Gotchas)\n    * [Autocomplete](#Autocomplete)\n    * [#Preview and enum reducers](#Preview-and-enum-reducers)\n    * [CI build failures](#CI-build-failures)\n\n## Conforming to the Reducer protocol\n\nThe bare minimum of conforming to the ``Reducer`` protocol is to provide a ``Reducer/State`` type\nthat represents the state your feature needs to do its job, a ``Reducer/Action`` type that\nrepresents the actions users can perform in your feature (as well as actions that effects can\nfeed back into the system), and a ``Reducer/body-20w8t`` property that compose your feature\ntogether with any other features that are needed (such as for navigation).\n\nAs a very simple example, a \"counter\" feature could model its state as a struct holding an integer:\n\n```swift\nstruct CounterFeature: Reducer {\n  @ObservableState\n  struct State {\n    var count = 0\n  }\n}\n```\n\n> Note: We have added the ``ObservableState()`` to `State` here so that the view can automatically\n> observe state changes. In future versions of the library this macro will be automatically applied\n> by the ``Reducer()`` macro.\n\nThe actions would be just two cases for tapping an increment or decrement button:\n\n```swift\nstruct CounterFeature: Reducer {\n  // ...\n  enum Action {\n    case decrementButtonTapped\n    case incrementButtonTapped\n  }\n}\n```\n\nThe logic of your feature is implemented by mutating the feature's current state when an action\ncomes into the system. This is most easily done by constructing a ``Reduce`` inside the\n``Reducer/body-20w8t`` of your reducer:\n\n```swift\nstruct CounterFeature: Reducer {\n  // ...\n  var body: some ReducerOf<Self> {\n    Reduce { state, action in\n      switch action {\n      case .decrementButtonTapped:\n        state.count -= 1\n        return .none\n      case .incrementButtonTapped:\n        state.count += 1  \n        return .none\n      }\n    }\n  }\n}\n```\n\nThe ``Reduce`` reducer's first responsibility is to mutate the feature's current state given an\naction. Its second responsibility is to return effects that will be executed asynchronously and feed\ntheir data back into the system. Currently `Feature` does not need to run any effects, and so\n``Effect/none`` is returned.\n\nIf the feature does need to do effectful work, then more would need to be done. For example, suppose\nthe feature has the ability to start and stop a timer, and with each tick of the timer the `count`\nwill be incremented. That could be done like so:\n\n```swift\nstruct CounterFeature: Reducer {\n  @ObservableState\n  struct State {\n    var count = 0\n  }\n  enum Action {\n    case decrementButtonTapped\n    case incrementButtonTapped\n    case startTimerButtonTapped\n    case stopTimerButtonTapped\n    case timerTick\n  }\n  enum CancelID { case timer }\n\n  var body: some ReducerOf<Self> {\n    Reduce { state, action in\n      switch action {\n      case .decrementButtonTapped:\n        state.count -= 1\n        return .none\n\n      case .incrementButtonTapped:\n        state.count += 1\n        return .none\n\n      case .startTimerButtonTapped:\n        return .run { send in\n          while true {\n            try await Task.sleep(for: .seconds(1))\n            await send(.timerTick)\n          }\n        }\n        .cancellable(CancelID.timer)\n\n      case .stopTimerButtonTapped:\n        return .cancel(CancelID.timer)\n\n      case .timerTick:\n        state.count += 1\n        return .none\n      }\n    }\n  }\n}\n```\n\n> Note: This sample emulates a timer by performing an infinite loop with a `Task.sleep` inside. This\n> is simple to do, but is also inaccurate since small imprecisions can accumulate. It would be\n> better to inject a clock into the feature so that you could use its `timer` method. Read the\n> <doc:DependencyManagement> and <doc:TestingTCA> articles for more information.\n\nThat is the basics of implementing a feature as a conformance to ``Reducer``. \n\n## Using the @Reducer macro\n\nWhile you technically can conform to the ``Reducer`` protocol directly, as we did above, the\n``Reducer()`` macro can automate many aspects of implementing features for you. At a bare minimum,\nall you have to do is annotate your reducer with `@Reducer` and you can even drop the `Reducer`\nconformance:\n\n```diff\n+@Reducer\n-struct CounterFeature: Reducer {\n+struct CounterFeature {\n   @ObservableState\n   struct State {\n     var count = 0\n   }\n   enum Action {\n     case decrementButtonTapped\n     case incrementButtonTapped\n   }\n   var body: some ReducerOf<Self> {\n     Reduce { state, action in\n       switch action {\n       case .decrementButtonTapped:\n         state.count -= 1\n         return .none\n       case .incrementButtonTapped:\n         state.count += 1  \n         return .none\n       }\n     }\n   }\n }\n```\n\nThere are a number of things the ``Reducer()`` macro does for you:\n\n### @CasePathable and @dynamicMemberLookup enums\n\nThe `@Reducer` macro automatically applies the [`@CasePathable`][casepathable-docs] macro to your\n`Action` enum:\n\n```diff\n+@CasePathable\n enum Action {\n   // ...\n }\n```\n\n[Case paths][casepaths-gh] are a tool that bring the power and ergonomics of key paths to enum\ncases, and they are a vital tool for composing reducers together.\n\nIn particular, having this macro applied to your `Action` enum will allow you to use key path\nsyntax for specifying enum cases in various APIs in the library, such as\n``Reducer/ifLet(_:action:destination:fileID:filePath:line:column:)-4ub6q``,\n``Reducer/forEach(_:action:destination:fileID:filePath:line:column:)-9svqb``, ``Scope``, and more.\n\nFurther, if the ``Reducer/State`` of your feature is an enum, which is useful for modeling a feature\nthat can be one of multiple mutually exclusive values, the ``Reducer()`` will apply the\n`@CasePathable` macro, as well as `@dynamicMemberLookup`:\n\n```diff\n+@CasePathable\n+@dynamicMemberLookup\n enum State {\n   // ...\n }\n```\n\nThis will allow you to use key path syntax for specifying case paths to the `State`'s cases, as well\nas allow you to use dot-chaining syntax for optionally extracting a case from the state. This can be\nuseful when using the operators that come with the library that allow for driving navigation from an\nenum of options:\n\n```swift\n.sheet(\n  item: $store.scope(\\.destination?.editForm, action: \\.destination.editForm)\n) { store in\n  FormView(store: store)\n}\n```\n\nThe syntax `\\.destination?.editForm` is only possible due to both `@dynamicMemberLookup` and\n`@CasePathable` being applied to the `State` enum.\n\n### Automatic fulfillment of reducer requirements\n\nThe ``Reducer()`` macro will automatically fill in any ``Reducer`` protocol requirements that you\nleave off. For example, something as simple as this compiles:\n\n```swift\n@Reducer\nstruct Feature {}\n```\n\nThe `@Reducer` macro will automatically insert an empty ``Reducer/State`` struct, an empty\n``Reducer/Action`` enum, and an empty ``Reducer/body-swift.property``. This effectively means that\n`Feature` is a logicless, behaviorless, inert reducer.\n\nHaving these requirements automatically fulfilled for you can be handy for slowly filling them in\nwith their real implementations. For example, this `Feature` reducer could be integrated in a parent\ndomain using the library's navigation tools, all without having implemented any of the domain yet.\nThen, once we are ready we can start implementing the real logic and behavior of the feature.\n\n### Destination and path reducers\n\nThere is a common pattern in the Composable Architecture of representing destinations a feature can\nnavigate to as a reducer that operates on enum state, with a case for each feature that can be\nnavigated to. This is explained in great detail in the <doc:TreeBasedNavigation> and\n<doc:StackBasedNavigation> articles.\n\nThis form of domain modeling can be very powerful, but also incur a bit of boilerplate. For example,\nif a feature can navigate to 3 other features, then one might have a `Destination` reducer like the\nfollowing:\n\n```swift\n@Reducer\nstruct Destination {\n  @ObservableState\n  enum State {\n    case add(FormFeature.State)\n    case detail(DetailFeature.State)\n    case edit(EditFeature.State)\n  }\n  enum Action {\n    case add(FormFeature.Action)\n    case detail(DetailFeature.Action)\n    case edit(EditFeature.Action)\n  }\n  var body: some ReducerOf<Self> {\n    Scope(\\.add, action: \\.add) {\n      FormFeature()\n    }\n    Scope(\\.detail, action: \\.detail) {\n      DetailFeature()\n    }\n    Scope(\\.edit, action: \\.edit) {\n      EditFeature()\n    }\n  }\n}\n```\n\nIt's not the worst code in the world, but it is 24 lines with a lot of repetition, and if we need to\nadd a new destination we must add a case to the ``Reducer/State`` enum, a case to the\n``Reducer/Action`` enum, and a ``Scope`` to the ``Reducer/body-swift.property``.\n\nThe ``Reducer()`` macro is now capable of generating all of this code for you from the following\nsimple declaration\n\n```swift\n@Reducer\nenum Destination {\n  case add(FormFeature)\n  case detail(DetailFeature)\n  case edit(EditFeature)\n}\n```\n\n24 lines of code has become 6. The `@Reducer` macro can now be applied to an _enum_ where each case\nholds onto the reducer that governs the logic and behavior for that case. Further, when using the\n``Reducer/ifLet(_:action:)`` operator with this style of `Destination` enum reducer you can\ncompletely leave off the trailing closure as it can be automatically inferred:\n\n```diff\n Reduce { state, action in\n   // Core feature logic\n }\n .ifLet(\\.$destination, action: \\.destination)\n-{\n-  Destination()\n-}\n```\n\nThis pattern also works for `Path` reducers, which is common when dealing with\n<doc:StackBasedNavigation>, and in that case you can leave off the trailing closure of the\n``Reducer/forEach(_:action:)`` operator:\n\n```diff\nReduce { state, action in\n  // Core feature logic\n}\n.forEach(\\.path, action: \\.path)\n-{\n-  Path()\n-}\n```\n\nFurther, for `Path` reducers in particular, the ``Reducer()`` macro also helps you reduce\nboilerplate when using the initializer \n``SwiftUI/NavigationStack/init(path:root:destination:fileID:filePath:line:column:)`` that comes with the library. \nIn the last trailing closure you can use the ``Store/case`` computed property to switch on the \n`Path.State` enum and extract out a store for each case:\n\n```swift\nNavigationStack(path: $store.scope(\\.path, action: \\.path)) {\n  // Root view\n} destination: { store in\n  switch store.case {\n  case let .add(store):\n    AddView(store: store)\n  case let .detail(store):\n    DetailView(store: store)\n  case let .edit(store):\n    EditView(store: store)\n  }\n}\n```\n\n#### Navigating to non-reducer features\n\nThere are many times that you want to present or navigate to a feature that is not modeled with a\nComposable Architecture reducer. This can happen with legacy features that are not built with the\nComposable Architecture, or with features that are very simple and do not need a fully built\nreducer.\n\nIn those cases you can use the ``ReducerCaseIgnored()`` and ``ReducerCaseEphemeral()`` macros to\nannotate cases that are not powered by reducers. See the documentation for those macros for more\ndetails.\n\nAs an example, suppose that you have a feature that can navigate to multiple features, all of \nwhich are Composable Architecture features except for one:\n\n```swift\n@Reducer\nenum Destination {\n  case add(AddItemFeature)\n  case edit(EditItemFeature)\n  @ReducerCaseIgnored\n  case item(Item)\n}\n```\n\nIn this situation the `.item` case holds onto a plain item and not a full reducer, and for that \nreason we have to ignore it from some of `@Reducer`'s macro expansion.\n\nThen, to present a view from this case one can do:\n\n```swift\n.sheet(item: $store.scope(\\.destination?.item, action: \\.destination.item)) { store in\n  ItemView(item: store.withState { $0 })\n}\n```\n\n> Note: The ``Store/withState(_:)`` is necessary because the value held inside the `.item` case\ndoes not have the ``ObservableState()`` macro applied, nor should it. And so using `withState`\nis a way to get access to the state in the store without any observation taking place.\n\n#### Synthesizing protocol conformances on State and Action\n\nSince the `State` and `Action` types are generated automatically for you when using `@Reducer` on an\nenum, you must extend these types yourself to synthesize conformances of `Equatable`, `Hashable`,\n_etc._:\n\n```swift\n@Reducer\nenum Destination {\n  // ...\n}\nextension Destination.State: Equatable {}\n```\n\n> Note: In Swift <6 the above extension causes a compiler error due to a bug in Swift.\n>\n> To work around this compiler bug, the library provides a version of the `@Reducer` macro that\n> takes two ``ComposableArchitecture/_SynthesizedConformance`` arguments, which allow you to\n> describe the protocols you want to attach to the `State` or `Action` types:\n>\n> ```swift\n> @Reducer(state: .equatable, .sendable, action: .sendable)\n> enum Destination {\n>   // ...\n> }\n> ```\n\n#### Nested enum reducers\n\nThere may be times when an enum reducer may want to nest another enum reducer. To do so, the parent\nenum reducer must specify the child's `Body` associated value and `body` static property explicitly:\n\n```swift\n@Reducer\nenum Modal { /* ... */ }\n\n@Reducer\nenum Destination {\n  case modal(Modal.Body = Modal.body)\n}\n```\n\n### Gotchas\n\n#### Autocomplete\n\nApplying `@Reducer` can break autocompletion in the `body` of the reducer. This is a known\n[issue](https://github.com/apple/swift/issues/69477), and it can generally be worked around by\nproviding additional type hints to the compiler:\n\n 1. Adding an explicit `Reducer` conformance in addition to the macro application can restore\n    autocomplete throughout the `body` of the reducer:\n\n    ```diff\n     @Reducer\n    -struct Feature {\n    +struct Feature: Reducer {\n    ```\n\n 2. Adding explicit generics to instances of `Reduce` in the `body` can restore autocomplete\n    inside the `Reduce`:\n\n    ```diff\n     var body: some Reducer<State, Action> {\n    -  Reduce { state, action in\n    +  Reduce<State, Action> { state, action in\n    ```\n\n#### #Preview and enum reducers\n\nThe `#Preview` macro is not capable of seeing the expansion of any macros since it is a macro \nitself. This means that when using destination and path reducers (see\n<doc:Reducer#Destination-and-path-reducers> above) you cannot construct the cases of the state \nenum inside `#Preview`:\n\n```swift\n#Preview {\n  FeatureView(\n    store: Store(\n      initialState: Feature.State(\n        destination: .edit(EditFeature.State())  // 🛑\n      )\n    ) {\n      Feature()\n    }\n  )\n}\n```\n\nThe `.edit` case is not usable from within `#Preview` since it is generated by the ``Reducer()``\nmacro.\n\nThe workaround is to move the view to a helper that be compiled outside of a macro, and then use it\ninside the macro:\n\n```swift\n#Preview {\n  preview\n}\nprivate var preview: some View {\n  FeatureView(\n    store: Store(\n      initialState: Feature.State(\n        destination: .edit(EditFeature.State())\n      )\n    ) {\n      Feature()\n    }\n  )\n}\n```\n\nYou can use a computed property, free function, or even a dedicated view if you want. You can also\nuse the old, non-macro style of previews by using a `PreviewProvider`:\n\n```swift\nstruct Feature_Previews: PreviewProvider {\n  static var previews: some  View {\n    FeatureView(\n      store: Store(\n        initialState: Feature.State(\n          destination: .edit(EditFeature.State())\n        )\n      ) {\n        Feature()\n      }\n    )\n  }\n}\n```\n\n#### Error: External macro implementation … could not be found\n\nWhen integrating with the Composable Architecture, one may encounter the following error:\n\n> Error: External macro implementation type 'ComposableArchitectureMacros.ReducerMacro' could not be\n> found for macro 'Reducer()'\n\nThis error can show up when the macro has not yet been enabled, which is a separate error that\nshould be visible from Xcode's Issue navigator.\n\nSometimes, however, this error will still emit due to an Xcode bug in which a custom build\nconfiguration name is being used in the project. In general, using a build configuration other than\n\"Debug\" or \"Release\" can trigger upstream build issues with Swift packages, and we recommend only\nusing the default \"Debug\" and \"Release\" build configuration names to avoid the above issue and\nothers.\n\n#### CI build failures\n\nWhen testing your code on an external CI server you may run into errors such as the following:\n\n> Error: CasePathsMacros Target 'CasePathsMacros' must be enabled before it can be used.\n>\n> ComposableArchitectureMacros Target 'ComposableArchitectureMacros' must be enabled before it can\n> be used.\n\nYou can fix this in one of two ways. You can write a default to the CI machine that allows Xcode to\nskip macro validation:\n\n```shell\ndefaults write com.apple.dt.Xcode IDESkipMacroFingerprintValidation -bool YES\n```\n\nOr if you are invoking `xcodebuild` directly in your CI scripts, you can pass the\n`-skipMacroValidation` flag to `xcodebuild` when building your project:\n\n```shell\nxcodebuild -skipMacroValidation …\n```\n\n[casepathable-docs]: https://swiftpackageindex.com/pointfreeco/swift-case-paths/main/documentation/casepaths/casepathable()\n[casepaths-gh]: http://github.com/pointfreeco/swift-case-paths\n\n\n## Topics\n\n### Implementing a reducer\n\n- ``Reducer()``\n- ``State``\n- ``Action``\n- ``body-swift.property``\n- ``Reduce``\n- ``Effect``\n\n### Composing reducers\n\n- ``ReducerBuilder``\n- ``CombineReducers``\n\n### Embedding child features\n\n- ``Scope``\n- ``ifLet(_:action:then:fileID:filePath:line:column:)-2r2pn``\n- ``ifCaseLet(_:action:then:fileID:filePath:line:column:)-7sg8d``\n- ``forEach(_:action:element:fileID:filePath:line:column:)-6zye8``\n- <doc:Navigation>\n\n### Supporting reducers\n\n- ``EmptyReducer``\n- ``BindingReducer``\n- ``Swift/Optional``\n\n### Reducer modifiers\n\n- ``dependency(_:_:)``\n- ``transformDependency(_:transform:)``\n- ``onChange(of:_:)``\n- ``signpost(_:log:)``\n- ``_printChanges(_:)``\n\n### Supporting types\n\n- ``ReducerOf``\n\n### Deprecations\n\n- <doc:ReducerDeprecations>\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBody.md (Tokens: ~24 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/Reducer/body-swift.property``\n\n## Topics\n\n### Associated type\n\n- ``Body``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerBuilder.md (Tokens: ~114 | Category: anthropic-skill) -->\n# ``ComposableArchitecture/ReducerBuilder``\n\n## Topics\n\n### Building reducers\n\n- ``buildExpression(_:)-cp3q``\n- ``buildExpression(_:)-9uxku``\n- ``buildBlock(_:)``\n- ``buildBlock()``\n- ``buildPartialBlock(first:)``\n- ``buildPartialBlock(accumulated:next:)``\n- ``buildOptional(_:)``\n- ``buildEither(first:)``\n- ``buildEither(second:)``\n- ``buildArray(_:)``\n- ``buildLimitedAvailability(_:)``\n- ``buildFinalResult(_:)``\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerForEach.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLet.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerlIfLetPresentation.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/ReducerMacro.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Scope.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/State.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/Store.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreDynamicMemberLookup.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/StoreState.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBinding.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeForEach.md)\n\n<!-- File: Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md (Tokens: ~300 | Category: anthropic-skill) -->\n# Extensions Skill\n\nPath: `Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md`\n\n[View Raw Content on GitHub](https://raw.githubusercontent.com/pointfreeco/swift-composable-architecture/HEAD/Sources/ComposableArchitecture/Documentation.docc/Extensions/SwiftUIBindingScopeIfLet.md)\n\n<!-- ... +11 more modular skills available via /api/skills/pointfreeco/swift-composable-architecture?path={path} -->\n</yakaai_skills>"}