Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Sources/ComposableArchitecture/ViewStore.swift
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ public final class ViewStore<State, Action>: ObservableObject {
///
/// For example, a text field binding can be created like this:
///
/// struct State { var name = "" }
/// typealias State = String
/// enum Action { case nameChanged(String) }
///
/// TextField(
Expand Down Expand Up @@ -199,14 +199,14 @@ public final class ViewStore<State, Action>: ObservableObject {
///
/// For example, an alert binding can be dealt with like this:
///
/// struct State { var alert: String? }
/// typealias State = String
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ha I'm a lil confused about these examples in general now. Since we have alert.message below...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this one has more things wrong with it than I saw at first. This probably got out of sync after the alert stuff.

/// enum Action { case alertDismissed }
///
/// .alert(
/// item: self.store.binding(
/// item: viewStore.binding(
/// send: .alertDismissed
/// )
/// ) { alert in Alert(title: Text(alert.message)) }
/// ) { title in Alert(title: Text(title)) }
///
/// - Parameters:
/// - action: The action to send when the binding is written to.
Expand Down