Skip to content

Instantly share code, notes, and snippets.

@danmt
Last active December 22, 2023 12:07
Show Gist options
  • Save danmt/d9735d58855c7849d848cb1f349dacf7 to your computer and use it in GitHub Desktop.
Save danmt/d9735d58855c7849d848cb1f349dacf7 to your computer and use it in GitHub Desktop.
Turn Factory of Promises into an Observable Factory
type AsObservableFactory<T> = T extends (...a: infer U) => Promise<infer V>
? (...a: U) => Observable<V>
: never;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment