Skip to content

Instantly share code, notes, and snippets.

@kean
Created February 26, 2020 01:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kean/a40d9b5bd190427a2e014f16a90460bb to your computer and use it in GitHub Desktop.
Save kean/a40d9b5bd190427a2e014f16a90460bb to your computer and use it in GitHub Desktop.
import Future
import Combine
public extension Future {
var publisher: Combine.Future<Value, Error> {
Combine.Future { fulfill in
self.on(success: {
fulfill(.success($0))
}, failure: {
fulfill(.failure($0))
})
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment