Skip to content

Instantly share code, notes, and snippets.

View observable.ts
interface Observer<T> {
next(value: T)
complete()
error(error: unknown)
}
class Observable<T> {
constructor(public subscribe: (observer: Observer<T>) => void) {}
map(mapper: (x: T) => T): Observable<T> {