-
Notifications
You must be signed in to change notification settings - Fork 62
docs(operators): add documentation for first #196
docs(operators): add documentation for first #196
Conversation
Codecov Report
@@ Coverage Diff @@
## master #196 +/- ##
=========================================
Coverage ? 77.14%
=========================================
Files ? 15
Lines ? 175
Branches ? 7
=========================================
Hits ? 135
Misses ? 40
Partials ? 0 Continue to review full report at Codecov.
|
name: 'first', | ||
operatorType: 'filtering', | ||
signature: `public first(predicate: function(value: T, index: number, source: Observable<T>): | ||
boolean, resultSelector: function(value: T, index: number): R, defaultValue: R): Observable<T | R>`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to show generic info (ex. Observable<T | R>) within the signature? Some we are, some we aren't. Personally I don't think it adds much value to the end user in this scenario but would be interested to hear others thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @benlesh let's leave it out bc it will get hard to read.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewing with @benlesh :D This is great!
name: 'first', | ||
operatorType: 'filtering', | ||
signature: `public first(predicate: function(value: T, index: number, source: Observable<T>): | ||
boolean, resultSelector: function(value: T, index: number): R, defaultValue: R): Observable<T | R>`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per @benlesh let's leave it out bc it will get hard to read.
const clicks = Rx.Observable.fromEvent(document, 'click'); | ||
const result = clicks.first(ev => ev.target.tagName === 'DIV'); | ||
result.subscribe(x => console.log(x)); | ||
`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's please use es6 imports! Most people will be using babel or typescript so we should show examples using that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also use the pipeable operators.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ladyleet Agree, I think most example code is not using them now because it's copied directly from JSBin.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@btroncone - should we merge this PR in ? and then deal with lettable operators for all examples?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I think so. 👍
e1ba55d
to
8a84e1c
Compare
Close #92