Skip to content

Instantly share code, notes, and snippets.

@hermanbanken
Created June 5, 2019 05:58
@available(iOS 13.0, *)
let p = Publishers.Future { (subscriber: @escaping (Result<Int,Error>) -> Void) in
DispatchQueue.main.asyncAfter(deadline: .now() + .seconds(2), execute: {
subscriber(.success(42))
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment