diff --git a/Sources/ComposableArchitecture/ViewStore.swift b/Sources/ComposableArchitecture/ViewStore.swift index 811c7d28745a..4a5b103244da 100644 --- a/Sources/ComposableArchitecture/ViewStore.swift +++ b/Sources/ComposableArchitecture/ViewStore.swift @@ -170,7 +170,7 @@ public final class ViewStore: 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( @@ -199,14 +199,14 @@ public final class ViewStore: ObservableObject { /// /// For example, an alert binding can be dealt with like this: /// - /// struct State { var alert: String? } + /// typealias State = String /// 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.