We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Actions that do not return value (such as shouldReturnKey) should be all able to be run in sequence to avoid passing the handler.
The technique works by reassigning the closure by also calling previous closure first:
extension EnvironmentValues { public var onSubmitAction: () -> Void { get { self[TriggerSubmitKey.self] } set { let oldValue = self[TriggerSubmitKey.self] self[TriggerSubmitKey.self] = { oldValue() newValue() } } } }
Similar to native onSubmit that is cumulative and runs all provided handlers, not just the innermost one.
onSubmit
https://www.fivestars.blog/articles/onsubmit/
The text was updated successfully, but these errors were encountered:
PavelHolec
No branches or pull requests
Actions that do not return value (such as shouldReturnKey) should be all able to be run in sequence to avoid passing the handler.
The technique works by reassigning the closure by also calling previous closure first:
Similar to native
onSubmit
that is cumulative and runs all provided handlers, not just the innermost one.https://www.fivestars.blog/articles/onsubmit/
The text was updated successfully, but these errors were encountered: