You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I like the redux way of linking the Android and IOS to the store data but find some limitations while working with multiple screens, one of them was how to use the ConnectedView struct on the IOS side as a generic type and pass the correct State based on the screen because now it's bound to the FeedState, therefore, I need to create another ConnectedView(or whatever) if I want to create another screen.
Something similar to the following:
public protocol ConnectedView: View {
....
func map(state: State, dispatch: @escaping DispatchFunction) -> Props
...
}
public extension ConnectedView {
func render(state: State, dispatch: @escaping DispatchFunction) -> V {
....
}
var body: StoreConnector<V> {
return StoreConnector(content: render)
}
}
public struct StoreConnector<V: View>: View {
@EnvironmentObject var store: ObservableObject
let content: (State, @escaping DispatchFunction) -> V
public var body: V {
return content(store.state, store.dispatch)
}
}
The text was updated successfully, but these errors were encountered:
Hi, I like the redux way of linking the Android and IOS to the store data but find some limitations while working with multiple screens, one of them was how to use the
ConnectedView
struct on the IOS side as a generic type and pass the correctState
based on the screen because now it's bound to theFeedState
, therefore, I need to create anotherConnectedView
(or whatever) if I want to create another screen.Something similar to the following:
The text was updated successfully, but these errors were encountered: