Add Store.init that takes reducer builder (#2087)

* Add `Store.init` that takes reducer builder

* wip

* wip

* added some tests

* wip

* wip

* wip

---------

Co-authored-by: Brandon Williams <mbrandonw@hey.com>
This commit is contained in:
Stephen Celis
2023-05-11 12:30:08 -07:00
committed by GitHub
parent c096892cad
commit 767231d179
119 changed files with 1363 additions and 1422 deletions

View File

@@ -17,10 +17,9 @@ let dataSource: [CaseStudy] = [
CaseStudy(
title: "Basics",
viewController: CounterViewController(
store: Store(
initialState: Counter.State(),
reducer: Counter()
)
store: Store(initialState: Counter.State()) {
Counter()
}
)
),
CaseStudy(
@@ -33,27 +32,26 @@ let dataSource: [CaseStudy] = [
Counter.State(),
Counter.State(),
]
),
reducer: CounterList()
)
)
) {
CounterList()
}
)
),
CaseStudy(
title: "Navigate and load",
viewController: EagerNavigationViewController(
store: Store(
initialState: EagerNavigation.State(),
reducer: EagerNavigation()
)
store: Store(initialState: EagerNavigation.State()) {
EagerNavigation()
}
)
),
CaseStudy(
title: "Load then navigate",
viewController: LazyNavigationViewController(
store: Store(
initialState: LazyNavigation.State(),
reducer: LazyNavigation()
)
store: Store(initialState: LazyNavigation.State()) {
LazyNavigation()
}
)
),
]