docs(operators): add documentation for first#196
docs(operators): add documentation for first#196ashwin-sureshkumar merged 2 commits intoReactiveX:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #196 +/- ##
=========================================
Coverage ? 77.14%
=========================================
Files ? 15
Lines ? 175
Branches ? 7
=========================================
Hits ? 135
Misses ? 40
Partials ? 0Continue 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.
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.
Per @benlesh let's leave it out bc it will get hard to read.
| 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.
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.
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.
Let's also use the pipeable operators.
There was a problem hiding this comment.
@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.
@btroncone - should we merge this PR in ? and then deal with lettable operators for all examples?
e1ba55d to
8a84e1c
Compare
Close #92