Created
January 10, 2017 22:59
-
-
Save plmrry/d39f71412df64dffbf2b5f8667f4e72f to your computer and use it in GitHub Desktop.
Stupid stream
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
class Stream<T> { | |
constructor(private start: Start<T>) {} | |
listen(next: Listener<T>) { this.start(next) } | |
} | |
class Stream<T> { | |
constructor(private start: Start<T>) {} | |
compose<U>(fn: (stream: Stream<T>) => Stream<U>): Stream<U> { | |
return fn(this); | |
} | |
listen(next: Listener<T>) { this.start(next) } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment