Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.

docs(operators): add documentation for first - #196

Merged
ashwin-sureshkumar merged 2 commits into
ReactiveX:masterfrom
ashwin-sureshkumar:issue-92
Jan 12, 2018
Merged

docs(operators): add documentation for first#196
ashwin-sureshkumar merged 2 commits into
ReactiveX:masterfrom
ashwin-sureshkumar:issue-92

Conversation

@ashwin-sureshkumar

Copy link
Copy Markdown
Collaborator

Close#92

@codecov-io

codecov-io commented Dec 8, 2017

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@f38fac7). Click here to learn what that means.
The diff coverage is n/a.

Impacted file tree graph

@@ 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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f38fac7...da2c8bf. Read the comment docs.

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>`,

Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown
Member

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.

@ladyleetladyleet left a comment

Copy link
Copy Markdown
Member

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>`,

Copy link
Copy Markdown
Member

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));
`,

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Collaborator

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.

Copy link
Copy Markdown
CollaboratorAuthor

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?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think so. 👍

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@ashwin-sureshkumar@codecov-io@sumitarora@btroncone@ladyleet