Replies: 2 comments 5 replies
-
Hi @K3TZR, there's a property on swift-composable-architecture/Sources/ComposableArchitecture/Store.swift Lines 402 to 406 in 12ae834 |
Beta Was this translation helpful? Give feedback.
1 reply
-
Ah I see. If each row of the view doesn't need actions, perhaps you don't even need a |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have a view that displays a list of Meters. It is "display only", i.e. no actions occur in this view. Here is the code of the main view followed by the Meter row view.
struct MeterView: View {
let store: Store<ApiState, ApiAction>
let sliceId: ObjectId?
var body: some View {
}
}
struct MeterRowView: View {
let store: Store<Meter, Never>
let sliceId: SliceId?
......
My question is how to express the scope statement without supplying an action. The action will never occur and having to supply it here (to please the compiler) requires me to create a useless action in ApiAction ( case meter(id: MeterId, action: MeterAction) ) and to define a useless value for MeterState ( public enum MeterAction { case anything } ).
I've tried a number of variations but can't seem to get it right. I wasn't able to find any examples other than a mention in the discussions that the Action parameter of the scope method is optional.
Beta Was this translation helpful? Give feedback.
All reactions