Hi guys I'm facing some troubles dealing with stores and arrays with multiple type of items.
Searching through the repo examples I found that with store.IfLet
you can deal with optional stores, like in the TicTacToe example. But how can I deal with an array of different items conforming the same protocol?
Some code
struct AppState {
var items: [RowInterface]
}
struct Item1: RowInterface {}
struct Item2: RowInterface {}
ForEachStore(
self.store.scope(state:\.items ,
action: { in _ fatalError() }),
// I want to be able to init one view for Item1 and another for Item2.
content: RowView.init(store:)
)