Created
April 8, 2016 07:27
-
-
Save milankinen/919666772d6e50ca320064575e8414db to your computer and use it in GitHub Desktop.
Rx .log monkey
This file contains hidden or 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
Rx.Observable.prototype.log = function(prefix) { | |
return process.env.NODE_ENV !== "development" ? this : this | |
.doOnCompleted(() => console.log(prefix, "<completed>")) // eslint-disable-line | |
.do(x => console.log(prefix, x)) // eslint-disable-line | |
} | |
// const obs = Rx.Observable.fromEvent(text, "input") | |
// .log("InputEvent:") | |
// .map(e => e.target.value) | |
// .filter(t => !!t) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment