Last active
August 31, 2017 18:39
-
-
Save mattpodwysocki/cc41a88b884fcc6e30d223580d71cfc0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
interface AsyncSubscription { | |
unsubscribeAsync(): Promise<void>; | |
} | |
interface AsyncObserver<T> { | |
next(value: T): Promise<void>; | |
error(error: any): Promise<void>; | |
complete(): Promise<void>; | |
} | |
interface AsyncObservable<T> { | |
subscribeAsync(observer: AsyncObserver<T>): AsyncSubscription; | |
[Symbol.asyncObservable](): AsyncObservable<T>; | |
} | |
export function create<T>( | |
factory: (observer: AsyncObserver<T>) => Promise<AsyncSubscription>): Promise<AsyncObservable> { | |
// TODO: Implementation | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment