Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdrone authored Mar 28, 2020
1 parent ecb5f28 commit 49ac359
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,7 @@ Using a `SerializableModelType` improves debuggability thanks to the console ou
As your app logic grows could be convient to split store into smaller one, still using the same root model.
This can be achieved by using the `makeChildStore(keyPath:)` API.

```
```swift
struct App {
struct Todo {
var name: String = "Untitled"
Expand Down Expand Up @@ -298,7 +297,6 @@ todoListStore.run(action: TodoListActionCreateNew(name: "New", decription: "New"

let todoStore = rootStore.makeChildStore(keyPath: \.[0])
todoStore.run(action: TodoActionMarkAsDone(), mode: .sync)
```

This is a good strategy to prevent passing down the whole application store as a dependency when not needed _(e.g. maybe your datasource just need the TodoList store and your cell the single-value Todo store)._
Expand Down

0 comments on commit 49ac359

Please sign in to comment.