Skip to content

Instantly share code, notes, and snippets.

@mattpodwysocki
Created March 10, 2015 19:36
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 mattpodwysocki/e3e6df438e0efbc1224a to your computer and use it in GitHub Desktop.
Save mattpodwysocki/e3e6df438e0efbc1224a to your computer and use it in GitHub Desktop.
interface Disposable {
dispose(): void
}
interface AsyncObservable<T> {
subscribe(observer: AsyncObserver<T>) : Disposable
// OR
forEach(observer: AsyncObserver<T>) : Disposable
}
interface AsyncObserver<T> {
onNext(value: T) : Promise
onError(error: Error) : Promise
onCompleted() : Promise
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment