Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlexanderBollbach/ce161d7c932bf6ac907f8d1f23428dda to your computer and use it in GitHub Desktop.
Save AlexanderBollbach/ce161d7c932bf6ac907f8d1f23428dda to your computer and use it in GitHub Desktop.
extension ViewStore where State == SomeState, Action == SomeAction {
var displayValue: String {
// do a bunch of querying on viewStore
return ""
}
func sendAction(with id: Int) -> Void {
// create a
if viewStore.isValid {
send(SomeAction.(at: id, value: SomeAction.SubAction.foo))
} else {
// do nothing
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment