Skip to content

Instantly share code, notes, and snippets.

@hermanbanken
Created June 5, 2019 05:58
Show Gist options
  • Select an option

  • Save hermanbanken/f85d5e7e9db39dda1b082f0f5b6b695d to your computer and use it in GitHub Desktop.

Select an option

Save hermanbanken/f85d5e7e9db39dda1b082f0f5b6b695d to your computer and use it in GitHub Desktop.
@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