Skip to content

adopt async/await #94

New issue

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

Closed
tomerd opened this issue Mar 30, 2021 · 2 comments
Closed

adopt async/await #94

tomerd opened this issue Mar 30, 2021 · 2 comments
Milestone

Comments

@tomerd
Copy link
Contributor

tomerd commented Mar 30, 2021

No description provided.

@tomerd tomerd added this to the 1.0.0 milestone Mar 30, 2021
@kirilltitov
Copy link

kirilltitov commented Apr 1, 2021

BTW this simple extension worked for me perfectly :)

public extension LifecycleHandler {
    init(_ handler: @escaping () async throws -> Void) {
        self = LifecycleHandler { callback in
            detach {
                do {
                    try await handler()
                    callback(nil)
                } catch {
                    callback(error)
                }
            }
        }
    }
}

@tomerd
Copy link
Contributor Author

tomerd commented Sep 5, 2021

closed via #99

@tomerd tomerd closed this as completed Sep 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants