{"id":21064620,"url":"https://github.com/capturecontext/composable-architecture-extensions","last_synced_at":"2026-02-13T17:19:39.125Z","repository":{"id":66258161,"uuid":"411645084","full_name":"CaptureContext/composable-architecture-extensions","owner":"CaptureContext","description":"Extension for TCA library (Update on hold, have to release major update to combine-navigation first)","archived":false,"fork":false,"pushed_at":"2024-03-30T11:31:22.000Z","size":108,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-13T20:31:28.129Z","etag":null,"topics":["cocoa","cocoatouch","composable-architecture","ios","macos","navigation","spm","swift","swiftpm","swiftui","tca","tvos","udf","uikit","watchos"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/CaptureContext.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-09-29T11:23:53.000Z","updated_at":"2023-12-15T03:45:02.000Z","dependencies_parsed_at":"2024-11-19T17:51:21.558Z","dependency_job_id":"41a514da-581d-468b-9353-3d5734e5d4ac","html_url":"https://github.com/CaptureContext/composable-architecture-extensions","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/CaptureContext/composable-architecture-extensions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptureContext%2Fcomposable-architecture-extensions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptureContext%2Fcomposable-architecture-extensions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptureContext%2Fcomposable-architecture-extensions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptureContext%2Fcomposable-architecture-extensions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/CaptureContext","download_url":"https://codeload.github.com/CaptureContext/composable-architecture-extensions/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/CaptureContext%2Fcomposable-architecture-extensions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29412928,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T06:24:03.484Z","status":"ssl_error","status_checked_at":"2026-02-13T06:23:12.830Z","response_time":78,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cocoa","cocoatouch","composable-architecture","ios","macos","navigation","spm","swift","swiftpm","swiftui","tca","tvos","udf","uikit","watchos"],"created_at":"2024-11-19T17:50:19.047Z","updated_at":"2026-02-13T17:19:39.116Z","avatar_url":"https://github.com/CaptureContext.png","language":"Swift","readme":"# composable-architecture-extensions\n\n[![CI](https://github.com/capturecontext/composable-architecture-extensions/actions/workflows/ci.yml/badge.svg)](https://github.com/capturecontext/composable-architecture-extensions/actions/workflows/ci.yml) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fcapturecontext%2Fcomposable-architecture-extensions%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/capturecontext/composable-architecture-extensions) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Fcapturecontext%2Fcomposable-architecture-extensions%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/capturecontext/composable-architecture-extensions)\n\nExtensions for [TCA](https://github.com/pointfreeco/swift-composable-architecture).\n\n\u003e [!NOTE]\n\u003e \n\u003e The package is early beta (feel free suggest your improvements [here](https://github.com/capturecontext/composable-architecture-extensions/discussions/1))\n\n## Table of contents\n\n- [Motivation](#motivation)\n- [Products](#products)\n  - [ComposableCore](#composablecore)\n  - [ComposableCocoa](#composablecocoa)\n  - [ComposableSwiftUI](#composableswiftui)\n  - [ComposableExtensions](#composableextensions)\n- [Installation](#installation)\n- [License](#license)\n\n## Products\n\n### ComposableCore\n\n#### ComposableCore\n\nCore manages underlying optional store, enables users to design UI components with lazy logical bindings. This approach allows to derive configuration logic out of initializers and treat components (primarilly UI-components) as containers that can exist without any logic.\n\n#### Composable(NS)Object\n\nIs a generic object driven by the core, since Swift doesn't allow inheritance from multiple classes, not every class that conforms to `ComposableObjectProtocol` can be downcasted to `ComposableObject`, good example is `ComposableObject` and `ComposableNSObject` classes, which are not interchangeable. Provides helpers for binding and scoping cores.\n\n```swift\nclass ExampleObject: ComposableObjectOf\u003cExampleFeature\u003e {\n  override func scope(_ store: Store?) {\n    super.scope(store)\n    \n    childObject.core.setStore(store?.scope(\n    \tstate: \\.child.state,\n    \taction: \\.child.action\n    ))\n  }\n  \n  override func bind(\n    _ store: Store,\n    into cancellables: Core.Cancellables\n  ) {\n    super.bind(store, into: cancellables)\n    \n    // This API is not yet available\n    store.observe(\\.text)\n      .assign(to: self, \\.text)\n      .store(in: cancellables)\n  }\n}\n```\n\n#### PullbackReducer\n\nPullbacks improve Reducers composition by replacing switch statements.\n\n```swift\nPullback(\\.path.to.child.action) { state in \n  return .send(.parentAction)\n}\n\nPullback(\\.path.to.child.action) { state, childAction in \n  return .send(.parentAction)\n}\n\nPullback(\\.path.to.children, action: \\.child.action) { state, id, childAction in \n  return .send(.parentAction)\n}\n```\n\n#### OnChangeReducer\n\nAllows to track changes in derived states.\n\n```swift\nSomeReducer().onChange(of: \\.localState) { state, oldValue, newValue in \n  return .send(.parentAction)\n}\n```\n\n#### ForEachReducer\n\nIndexed ForEach is useful when working with arrays\n\n```swift\n._forEach(\n  \\.arrayOfElements, // non-identified\n  action: \\.pathToAction,\n  element: { ElementReducer() }\n)\n```\n\nLabeled ForEach is useful for multiline ergonomics\n\n```swift\nforEach(\n  state: \\.arrayOfElements,\n  action: \\.pathToAction,\n  element: { ElementReducer() }\n)\n\n._forEach(\n  state: \\.arrayOfElements, // non-identified\n  action: \\.pathToAction,\n  element: { ElementReducer() }\n)\n```\n\n### ComposableCocoa\n\n\u003e [!NOTE]\n\u003e\n\u003e _The product is compatible with non-Apple platforms, however it uses conditional compilation, so **APIs are only available on Apple platforms**_\n\n#### ComposableCocoaView\n\n`CustomCocoaView` that is also `ComposableObjectProtocol`\n\n```swift\npublic class ExampleCocoaView: ComposableCocoaViewOf\u003cExampleFeature\u003e {\n  // Initial configuration\n  override public func _init() {\n    super._init()\n  }\n  \n  // Action example\n  func onTap() {\n    core.store?.send(.tap)\n  }\n  \n  // Scoping\n  override public func scope(_ store: Store?) {\n    super.scope(store)\n    \n    childView.core.setStore(store?.scope(\n      state: \\.child.state,\n      action: \\.child.action\n    ))\n  }\n  \n  // Binding\n  override public func bind(\n    _ store: Store,\n    into cancellables: Core.Cancellables\n  ) {\n    super.bind(store, into: cancellables)\n    \n    // This API is not yet available\n    store.observe(\\.text)\n      .assign(to: label, \\.text)\n      .store(in: cancellables)\n  }\n}\n```\n\n#### ComposableViewController\n\n`CustomCocoaViewController` that is also `ComposableObjectProtocol`. Composable controllers won't scope/bind values untill managed object is loaded (view for ViewControllers, window for WindowControllers). API is similar to `ComposableCocoaView`.\n\n- `ComposableTabViewController` is also available on `iOS`\n- `ComposableWindowController` is available on `macOS`\n\n### ComposableSwiftUI\n\n\u003e [!NOTE]\n\u003e\n\u003e _The product is compatible with non-Apple platforms, however it uses conditional compilation, so **APIs are only available on Apple platforms**_\n\n#### ComposableView\n\nProtocol for SwiftUI views that improves composability. Composable views can only be initialized with optional stores.\n\n```swift\npublic struct ExampleView: ComposableView {\n  @UIBindable\n  private var store: StoreOf\u003cExampleFeature\u003e\n  \n  public init(_ store: StoreOf\u003cExampleFeature\u003e) {\n    self.store = store\n  }\n  \n  public var body: some View { /*...*/ }\n}\n```\n\n### ComposableExtensions\n\nUmbrella product that exports everything.\n\n## Installation\n\n### Basic\n\nYou can add `composable-architecture-extensions` to an Xcode project by adding it as a package dependency\n\n1. From the **File** menu, select **Swift Packages › Add Package Dependency…**\n2. Enter [`\"https://github.com/capturecontext/composable-architecture-extensions\"`](https://github.com/capturecontext/composable-architecture-extensions) into the package repository URL text field\n3. Choose products you need to link to your project.\n\n### Recommended\n\nIf you use SwiftPM for your project structure, add `composable-architecture-extensions` dependency to your package file. \n\n```swift\n.package(\n  url: \"https://github.com/capturecontext/composable-architecture-extensions.git\", \n  .upToNextMinor(\"0.3.0-alpha.1\")\n)\n```\n\nDo not forget about target dependencies:\n\n```swift\n.product(\n  name: \"\u003c#Product#\u003e\", \n  package: \"composable-architecture-extensions\"\n)\n```\n\n## License\n\nThis library is released under the MIT license. See [LICENSE](LICENSE) for details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapturecontext%2Fcomposable-architecture-extensions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcapturecontext%2Fcomposable-architecture-extensions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcapturecontext%2Fcomposable-architecture-extensions/lists"}