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

Commit c7a44e3

Browse files
author
Diedrik De Mits
committed
docs(operators): Use markdown-code class and update examples
Modify the code tags to spans with markdown-code classes and update the examples so they show less clutter on the console when logging clicks #111
1 parent 2928a0f commit c7a44e3

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/operator-docs/transformation/bufferTime.ts

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,16 @@ export const bufferTime: OperatorDoc = {
4343
},
4444
walkthrough: {
4545
description: `
46-
Buffers values from the source for a specific time duration <code>bufferTimeSpan</code>.
47-
It emits and resets the buffer every <code>bufferTimeSpan</code> milliseconds,
48-
unless the optional argument <code>bufferCreationInterval</code> is given.
49-
If <code>bufferCreationInterval</code> is given,
50-
this operator emits the buffered values and re-opens the buffer every <code>bufferCreationInterval</code> milliseconds
51-
and closes (no further values are buffered) the buffer every <code>bufferTimeSpan</code> milliseconds.
52-
When the optional argument <code>maxBufferSize</code> is specified,
53-
the buffer will be closed either after <code>bufferTimeSpan</code> milliseconds
54-
or when it contains <code>maxBufferSize</code> elements.`
46+
Buffers values from the source for a specific time duration <span class="markdown-code">bufferTimeSpan</span>.
47+
It emits and resets the buffer every <span class="markdown-code">bufferTimeSpan</span> milliseconds,
48+
unless the optional argument <span class="markdown-code">bufferCreationInterval</span> is given.
49+
If <span class="markdown-code">bufferCreationInterval</span> is given,
50+
this operator emits the buffered values and re-opens the buffer every <span class="markdown-code">bufferCreationInterval</span>
51+
milliseconds and closes (no further values are buffered) the buffer every
52+
<span class="markdown-code">bufferTimeSpan</span> milliseconds.
53+
When the optional argument <span class="markdown-code">maxBufferSize</span> is specified,
54+
the buffer will be closed either after <span class="markdown-code">bufferTimeSpan</span> milliseconds
55+
or when it contains <span class="markdown-code">maxBufferSize</span> elements.`
5556
},
5657
examples: [
5758
{
@@ -63,13 +64,14 @@ import { map, bufferTime } from 'rxjs/operators';
6364
6465
const clicks = fromEvent(document, 'click');
6566
const buffered = clicks.pipe(
67+
map(e => { return {x: e.clientX, y: e.clientY}; }),
6668
bufferTime(2500)
6769
);
6870
buffered.subscribe(x => console.log(x));
6971
`,
7072
externalLink: {
7173
platform: 'JSBin',
72-
url: 'http://jsbin.com/fuqewiy/1/embed?js,console,output'
74+
url: 'http://jsbin.com/fuqewiy/3/embed?js,console,output'
7375
}
7476
},
7577
{
@@ -81,13 +83,14 @@ buffered.subscribe(x => console.log(x));
8183
8284
const clicks = fromEvent(document, 'click');
8385
const buffered = clicks.pipe(
86+
map(e => { return {x: e.clientX, y: e.clientY}; }),
8487
bufferTime(2000, 5000)
8588
);
8689
buffered.subscribe(x => console.log(x));
8790
`,
8891
externalLink: {
8992
platform: 'JSBin',
90-
url: 'http://jsbin.com/xohupot/embed?js,console,output'
93+
url: 'http://jsbin.com/xohupot/1/embed?js,console,output'
9194
}
9295
}
9396
],

0 commit comments

Comments
 (0)