Commit Graph

17 Commits

Author SHA1 Message Date
Thomas Grapperon
37d05164c3 Conform WithViewStore to Commands (#1113)
* Conform `WithViewStore` to `Commands`

* Fix typo

* Add coverage for `Commands`

* Fix documentation

* Conform `WithViewStore` to `AccessibilityRotorContent` and `ToolbarContent`

* Conform `WithViewStore` to `TableColumnContent`

* Fix indentation

* Conform `WithViewStore` to `TableRowContent`

* Fix Typo

* Conform `WithViewStore` to `DynamicTableRowContent`

* Reorder declarations according to the protocol name

* Add coverage for `WithViewStore` new conformances

* Remove Table-related conformances

* Rearrange extensions for better autocomplete.

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2022-06-03 11:53:54 -04:00
Thomas Grapperon
85050a28a9 Fix WithViewStore issues with Views using escaping closures (#1015)
* Use a new instance of `ViewStore` in `WithViewStore`'s `body`

* Use explicit `self` for style coherence

* Remove `viewCancellable` additional reference in `newInstance()`

* Revert "Remove `viewCancellable` additional reference in `newInstance()`"

This reverts commit cb6a22ae4f.

* Change `viewCancellable` capture list

* Update `GeometryReader`'s workarounds
2022-03-11 15:23:42 -05:00
Brandon Williams
d165966898 Don't print to console when dumping state for ViewStore.debug (#829) 2021-09-24 10:22:22 -04:00
Stephen Celis
575d7c0d59 Use Custom Dump (#736)
* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* fix

* wip

* wip

* Model Tic-Tac-Toe board using proper type

* wip

* wip

* wip

* wip

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-08-22 22:45:27 -04:00
stephencelis
67ccab6bce Run swift-format 2021-08-11 16:13:31 +00:00
Stephen Celis
e73b36e2cb WithViewStore debug state diffs (#706)
* WithViewStore debug state diffs

* More debug checks

* fix

* wip
2021-08-11 11:55:08 -04:00
Wendy Liga
1a8bccc62e Support DocC Xcode 13 (#591)
* wip

* finish

* revert back code snippet identation to 5

* Update Sources/ComposableArchitecture/Effect.swift

Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>

Co-authored-by: Brandon Williams <135203+mbrandonw@users.noreply.github.com>
2021-06-14 14:10:08 -04:00
Stephen Celis
f8608c7421 Breakpoint instead of assert in optional/forEach (#296)
* Breakpoint instead of assert in optional/forEach

* fix merge

Co-authored-by: Brandon Williams <mbw234@gmail.com>
Co-authored-by: Brandon Williams <mbrandonw@hey.com>
2021-03-02 13:03:15 -05:00
Stephen Celis
e51fb00d1f Remove type alias for Xcode 12.5 compatibility (#371)
* Remove type alias

* Fix a few warnings
2021-02-01 14:55:29 -05:00
Stephen Celis
4c7bd31336 Format and coverage 2021-01-12 09:45:48 -05:00
stephencelis
b1e2dced5b Run swift-format 2021-01-12 00:51:35 +00:00
Max Desiatov
9fbd834664 Add Scene conformance to WithViewStore (#336)
* Add SceneWithViewStore for accessing stores in scenes

This would allow accessing `ViewStore` instances from a `body` definition of a type conforming to `Scene`. It could be useful for conditional rendering of scenes or sending actions from scene commands. Here's an example:

```swift
import ComposableArchitecture
import SwiftUI

@main
struct CommandsApp: App {
  private let store = Store(
    initialState: RootState(),
    reducer: rootReducer,
    environment: .live(rootEnvironment)
  )

  var body: some Scene {
    SceneWithViewStore(store) { viewStore in
      WindowGroup {
        WorkspaceView()
      }.commands {
        CommandGroup(after: CommandGroupPlacement.newItem) {
          Button("Open...") {
            viewStore.send(.open)
          }.keyboardShortcut("o", modifiers: [.command])
        }
      }
    }
  }
}
```

* Avoid building SceneWithViewStore with old Xcode

* Separate Catalina and Big Sur jobs

This allows testing APIs that are only available on Big Sur

* Unify `WithViewStore` and `SceneWithViewStore`
2021-01-11 19:38:09 -05:00
Stephen Celis
32acc6a859 Document ScrollViewReader problem (#268) 2020-08-26 13:02:59 -04:00
Stephen Celis
e8e272a7c0 Make Reducer.debug API more like Publisher.print (#111)
* Make Reducer.debug API more like Publisher.print

* Deprecations
2020-05-18 11:18:11 -04:00
Stephen Celis
a90c48924f Wrap WithViewStore debugging in compiler directive (#99) 2020-05-14 21:07:45 -04:00
Stephen Celis
b4779b36b1 Helpers for making stores stateless/actionless (#45) 2020-05-11 18:40:09 -04:00
Brandon Williams
d2240d0e76 The Composable Architecture
Co-authored-by: Stephen Celis <stephen.celis@gmail.com>
2020-05-03 22:26:28 -07:00