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:
Stephen Celis
2023-12-19 18:35:08 -08:00
committed by GitHub
parent b091bd72fd
commit 087b6b5730
28 changed files with 722 additions and 1005 deletions

View File

@@ -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) }
)
)
}