Skip to content

Instantly share code, notes, and snippets.

@vincent-pradeilles
Last active August 16, 2017 13:22
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 vincent-pradeilles/4acd7fbcbdd17734c8bcc149a28fc8ca to your computer and use it in GitHub Desktop.
Save vincent-pradeilles/4acd7fbcbdd17734c8bcc149a28fc8ca to your computer and use it in GitHub Desktop.
func fromAsync<T, U>(_ asyncRequest: @escaping (T, @escaping (U) -> Void) -> Void) -> (T) -> Observable<U> {
return { (a: T) in fromAsync(curry(asyncRequest)(a)) }
}
func fromAsync<T, U, V>(_ asyncRequest: @escaping (T, U, @escaping (V) -> Void) -> Void) -> (T, U) -> Observable<V> {
return { (a: T, b: U) in fromAsync(curry(asyncRequest)(a)(b)) }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment