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

docs(operators): add documentation for sample & sampleTime #207

Open
wants to merge 22 commits into
base: master
Choose a base branch
from
Open

docs(operators): add documentation for sample & sampleTime #207

wants to merge 22 commits into from

Conversation

hardikpthv
Copy link
Contributor

Closes: #192

@codecov-io
Copy link

codecov-io commented Dec 14, 2017

Codecov Report

Merging #207 into master will increase coverage by 0.04%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #207      +/-   ##
==========================================
+ Coverage   90.78%   90.82%   +0.04%     
==========================================
  Files         116      117       +1     
  Lines         445      447       +2     
  Branches        9        9              
==========================================
+ Hits          404      406       +2     
  Misses         40       40              
  Partials        1        1
Impacted Files Coverage Δ
src/operator-docs/filtering/sample.ts 100% <ø> (ø) ⬆️
src/operator-docs/filtering/index.ts 100% <100%> (ø) ⬆️
src/operator-docs/filtering/sampleTime.ts 100% <100%> (ø)

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 4097607...82e67e4. Read the comment docs.

@sumitarora sumitarora changed the title Iss 192 docs(operators): add documentation for sample & sampleTime Dec 14, 2017
Copy link
Collaborator

@btroncone btroncone left a comment

Choose a reason for hiding this comment

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

Looks great, just one small change. Thanks for the PR! 👍

extras: [
{
type: 'Tip',
text: `It's like sampleTime, but samples whenever the notifier Observable emits something.`
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can we add a link here to sampleTime?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, i will add it.

`,
externalLink: {
platform: 'JSBin',
url: 'http://jsbin.com/xapiviz/edit?js,console,output'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please use embedded instead of edit.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops! Yeah of course.

`,
externalLink: {
platform: 'JSBin',
url: 'http://jsbin.com/hohulon/edit?js,console,output'
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

@ashwin-sureshkumar
Copy link
Collaborator

@hardikpthv - awesome job !!

Please make sure there is a single operator per PR. Easier to organize and track.

Also there is already a PR for sample. I will close it. Let's make sure we don't repeat work :)

@hardikpthv
Copy link
Contributor Author

Oh i see! @ashwin-sureshkumar I will keep it in mind. :)

@ashwin-sureshkumar
Copy link
Collaborator

@sumitarora @btroncone - Can you please re-review this PR?

@ashwin-sureshkumar
Copy link
Collaborator

@btroncone @sumitarora - please re-review when get a chance

@ashwin-sureshkumar
Copy link
Collaborator

@btroncone @sumitarora - please re-review when get a chance

@ashwin-sureshkumar
Copy link
Collaborator

@btroncone @sumitarora - please re-review when get a chance

name: 'sampleTime',
operatorType: 'filtering',
signature:
'public sampleTime(period: number, scheduler: Scheduler): Observable<T>',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove generic

{
name: 'Every second, emit the most recent click at most once',
code: `
const clicks = Rx.Observable.fromEvent(document, 'click');
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Update it to ES6 imports

code: `
const clicks = Rx.Observable.fromEvent(document, 'click');
const result = clicks.sampleTime(1000);
result.subscribe(x => console.log(x));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Add expected output

Copy link
Member

Choose a reason for hiding this comment

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

@hardikpthv I'm a bit confused :D will you take care of your comments in this pr :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure @jwo719 It is for my reference :D

@hardikpthv
Copy link
Contributor Author

I think sample operator can be ignored as it's already there.

@hardikpthv
Copy link
Contributor Author

can this be merged @ashwin-sureshkumar or any changes expected?

Sign up for free to 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.

6 participants