-
Notifications
You must be signed in to change notification settings - Fork 61
docs(operators): add documentation for operator scan #175
Conversation
Add initial version of documentation for transformation operator 'scan' closes ReactiveX#122
Generated by 🚫 dangerJS |
Codecov Report
@@ Coverage Diff @@
## master #175 +/- ##
=======================================
Coverage 74.78% 74.78%
=======================================
Files 9 9
Lines 119 119
Branches 6 6
=======================================
Hits 89 89
Misses 30 30Continue to review full report at Codecov.
|
|
Hmm, not sure why all the package-lock.json is showing up as a change.... The only file I changed was the scan.ts file. Anyone know why this would be happening? |
btroncone
left a comment
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.
Really awesome work, thanks! Just a few small tweaks. 👍
| <p> | ||
| Combines together all values emitted on the source, using an accumulator | ||
| function that knows how to join a new source value into the accumulation from | ||
| the past. Is similar to <span class="markdown-code">reduce</span>, but emits the intermediate accumulations. |
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.
Could you turn this into a link to reduce?
| description: 'The initial accumulation value.' | ||
| } | ||
| ], | ||
| marbleUrl: 'http://reactivex.io/rxjs/img/scan.png', |
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.
It looks like scan has an interactive marble diagram available (http://rxmarbles.com/#scan). Could you set useInteractiveMarbles property to true? This will use that on the page rather than the static image.
|
@natmegs - What version of |
|
Thanks for the feedback and sorry for the delay. I added the changes but as far as I can tell there is no page set up for reduce, so that link won't work until that page is created. |
|
thx @natmegs! |
|
@btroncone - please re-review when you get a chance. |
ladyleet
left a comment
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.
Great job Nat! Loved this - I am reviewing with Ben so... he's a little harder on the docs than everyone else. ;) But, it's also great! <3
| let ones = clicks.mapTo(1); | ||
| let seed = 0; | ||
| let count = ones.scan((acc, one) => acc + one, seed); | ||
| count.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.
- Should use const vs let
- Use ES6 style imports
- Use pipeable operators
- Use rxjs/observable/fromEvent
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 @ashwin-sureshkumar @sumitarora to note from @benlesh
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 Thanks for the feedback! To make sure I've understood this correctly before I commit, should it look like this?
const clicks = Rx.Observable.fromEvent(document, 'click');
const ones = clicks.mapTo(1);
const seed = 0;
const count = ones.pipe(scan((acc, one) => acc + one, seed));
count.subscribe(x => console.log(x));
|
I've resolved the conflicts and merged. Thanks, @natmegs!! (@ladyleet, @btroncone, et al: we should probably not be committing the package-lock.json for this project, it seems to be a source of merge pain more than it helps) (nothing to do with you, @natmegs). |
Add initial version of documentation for transformation operator 'scan'
closes #122