mirror of
https://github.com/pointfreeco/swift-composable-architecture.git
synced 2025-12-24 12:14:25 +01:00
Overhaul store scope communication (#2664)
* store 2 * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * check sharesStorage in == * wip * wip * fix crashes * wip * wip * wip * wip * clean up * wip * wip * wip * wip * rename * wip * wip * fix * stack * wip * wip * wip * wip * wip * wip * remove duplicates based on presentation storage * wip * wip * wip * wip * update log snapshots * bring back expected failure * wip * remove removeDuplicates * test for fast path of PresentationState * wip * Updated logs * wip * wip * wip * wip * Skip flakey CI test * bump timeout --------- Co-authored-by: Brandon Williams <mbrandonw@hey.com>
This commit is contained in:
@@ -114,13 +114,16 @@ public struct ForEachStore<
|
||||
) { viewStore in
|
||||
ForEach(viewStore.state, id: viewStore.state.id) { element in
|
||||
let id = element[keyPath: viewStore.state.id]
|
||||
var element = element
|
||||
content(
|
||||
store.scope(
|
||||
state: { $0[id: id]! },
|
||||
state: ToState {
|
||||
element = $0[id: id] ?? element
|
||||
return element
|
||||
},
|
||||
id: store.id(state: \.[id:id]!, action: \.[id:id]),
|
||||
action: { .element(id: id, action: $0) },
|
||||
isInvalid: { !$0.ids.contains(id) },
|
||||
removeDuplicates: nil
|
||||
isInvalid: { !$0.ids.contains(id) }
|
||||
)
|
||||
)
|
||||
}
|
||||
@@ -170,13 +173,16 @@ public struct ForEachStore<
|
||||
) { viewStore in
|
||||
ForEach(viewStore.state, id: viewStore.state.id) { element in
|
||||
let id = element[keyPath: viewStore.state.id]
|
||||
var element = element
|
||||
content(
|
||||
store.scope(
|
||||
state: { $0[id: id]! },
|
||||
state: ToState {
|
||||
element = $0[id: id] ?? element
|
||||
return element
|
||||
},
|
||||
id: store.id(state: \.[id:id]!, action: \.[id:id]),
|
||||
action: { (id, $0) },
|
||||
isInvalid: { !$0.ids.contains(id) },
|
||||
removeDuplicates: nil
|
||||
isInvalid: { !$0.ids.contains(id) }
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user