Skip to content

Commit 933547c

Browse files
authored
minor grammar cleanup (#33)
1 parent e520ba8 commit 933547c

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
A simple Elm-like Store for SwiftUI, based on [ObservableObject](https://developer.apple.com/documentation/combine/observableobject).
44

5-
ObservableStore helps you craft more reliable apps by centralizing all of your application state into one place, and giving you a deterministic system for managing state changes and side-effects. All state updates happen through actions passed to an update function. This guarantees your application will produce exactly the same state, given the same actions in the same order. If you’ve ever used [Elm](https://guide.elm-lang.org/architecture/) or [Redux](https://redux.js.org/), you get the gist.
5+
ObservableStore helps you craft more reliable apps, by centralizing all of your application state into one place and giving you a deterministic system for managing state changes and side-effects. All state updates happen through actions passed to an update function. This guarantees your application will produce exactly the same state, given the same actions in the same order. If you’ve ever used [Elm](https://guide.elm-lang.org/architecture/) or [Redux](https://redux.js.org/), you get the gist.
66

77
Because `Store` is an [ObservableObject](https://developer.apple.com/documentation/combine/observableobject), it can be used anywhere in SwiftUI that ObservableObject would be used.
88

@@ -105,9 +105,9 @@ The `Update` returned is a small struct that contains a new state, plus any opti
105105

106106
## Effects
107107

108-
Updates are also able to produce asynchronous effects via [Combine](https://developer.apple.com/documentation/combine) publishers. This gives you a deterministic way to schedule sync and async side-effects like HTTP requests or database calls in response to actions.
108+
Updates are also able to produce asynchronous effects via [Combine](https://developer.apple.com/documentation/combine) publishers. This gives you a deterministic way to schedule sync and async side-effects, like HTTP requests or database calls in response to actions.
109109

110-
Effects are modeled as [Combine Publishers](https://developer.apple.com/documentation/combine/publishers) which publish actions and never fail. For convenience, ObservableStore defines a typealias for effect publishers:
110+
Effects are modeled as [Combine Publishers](https://developer.apple.com/documentation/combine/publishers), which publish actions and never fail. For convenience, ObservableStore defines a typealias for effect publishers:
111111

112112
```swift
113113
public typealias Fx<Action> = AnyPublisher<Action, Never>
@@ -149,7 +149,7 @@ func update(
149149
}
150150
```
151151

152-
Store will manage the lifecycle of any publishers returned by an Update, piping the actions they produce back into the store, producing new states, and cleaning them up when they complete.
152+
Store will manage the lifecycle of any publishers returned by an Update; piping the actions they produce back into the store, producing new states, and cleaning them up when they complete.
153153

154154
## Animations
155155

@@ -183,7 +183,7 @@ There are a few different ways to work with Store in views.
183183
Text(store.state.text)
184184
```
185185

186-
`Store.send(_)` lets you send actions to the store to change state. You might call send within a button action, or event callback, for example.
186+
`Store.send(_)` lets you send actions to the store to change state. You might call send within a button action or event callback, for example.
187187

188188
```swift
189189
Button("Set color to red") {
@@ -193,7 +193,7 @@ Button("Set color to red") {
193193

194194
## Bindings
195195

196-
`StoreProtocol.binding(get:tag:)` lets you create a [binding](https://developer.apple.com/documentation/swiftui/binding) that represents some part of a store state. The `get` closure reads the state into a value, and the `tag` closure wraps the value set on the binding in an action. The result is a binding that can be passed to any vanilla SwiftUI view, but changes state only through deterministic updates.
196+
`StoreProtocol.binding(get:tag:)` lets you create a [binding](https://developer.apple.com/documentation/swiftui/binding) that represents some part of a store state. The `get` closure reads the state into a value, and the `tag` closure wraps the value set on the binding in an action. The result is a binding that can be passed to any vanilla SwiftUI view, changing state only through deterministic updates.
197197

198198
```swift
199199
TextField(
@@ -205,7 +205,7 @@ TextField(
205205
)
206206
```
207207

208-
Bottom line, because Store is just an ordinary [ObservableObject](https://developer.apple.com/documentation/combine/observableobject), and can produce bindings, you can write views exactly the same way you write vanilla SwiftUI views. No special magic! Properties, [@Binding](https://developer.apple.com/documentation/swiftui/binding), [@ObservedObject](https://developer.apple.com/documentation/swiftui/observedobject), [@StateObject](https://developer.apple.com/documentation/swiftui/stateobject) and [@EnvironmentObject](https://developer.apple.com/documentation/swiftui/environmentobject) all work as you would expect.
208+
Bottom line, because Store is just an ordinary [ObservableObject](https://developer.apple.com/documentation/combine/observableobject) and can produce bindings, you can write views exactly the same way you write vanilla SwiftUI views. No special magic! Properties, [@Binding](https://developer.apple.com/documentation/swiftui/binding), [@ObservedObject](https://developer.apple.com/documentation/swiftui/observedobject), [@StateObject](https://developer.apple.com/documentation/swiftui/stateobject) and [@EnvironmentObject](https://developer.apple.com/documentation/swiftui/environmentobject) all work as you would expect.
209209

210210

211211
## Creating scoped child components
@@ -259,7 +259,7 @@ To integrate this child component with a parent component, we're going to need 3
259259
- A function to `set` a local state on a root state
260260
- A function to `tag` a local action so it becomes a root action
261261

262-
Together, these functions give us everything we need to map from child domain to a parent domain. Let's define them as static functions so we have them all in one place.
262+
Together, these functions give us everything we need to map from child domain to a parent domain. Let's define them as static functions, so we have them all in one place.
263263

264264
```swift
265265
struct AppChildCursor {
@@ -287,7 +287,7 @@ struct AppChildCursor {
287287

288288
Ok, now that we have everything we need to map from the parent domain to the child domain, let's integrate the child view with the parent view.
289289

290-
We call the `store.viewStore(get:tag:)` method to create a scoped ViewStore from our store, and pass it the appropriate cursor functions.
290+
We call the `store.viewStore(get:tag:)` method to create a scoped ViewStore from our store and pass it the appropriate cursor functions.
291291

292292
```swift
293293
struct ContentView: View {

0 commit comments

Comments
 (0)