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

Commit 08a8185

Browse files
committed
docs(operators): add documentation for operator buffer
Add initial version of documentation for transformation operator 'buffer'
1 parent 8dd3584 commit 08a8185

File tree

1 file changed

+53
-2
lines changed

1 file changed

+53
-2
lines changed
Lines changed: 53 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,57 @@
11
import { OperatorDoc } from '../operator.model';
22

33
export const buffer: OperatorDoc = {
4-
'name': 'buffer',
5-
'operatorType': 'transformation'
4+
name: 'buffer',
5+
operatorType: 'transformation',
6+
signature: 'public buffer(closingNotifier: Observable): Observable',
7+
useInteractiveMarbles: true,
8+
parameters: [
9+
{
10+
name: 'closingNotifier',
11+
type: 'Observable',
12+
attribute: '',
13+
description:
14+
'An Observable that signals the buffer to be emitted on the output Observable.'
15+
}
16+
],
17+
marbleUrl: 'http://reactivex.io/rxjs/img/buffer.png',
18+
shortDescription: {
19+
description: `
20+
Buffers the source Observable values until <span class="markdown-code">closingNotifier</span>
21+
emits.
22+
`
23+
},
24+
walkthrough: {
25+
description: `
26+
<p>
27+
Buffers the incoming Observable values until the given
28+
<span class="markdown-code">closingNotifier</span> Observable emits a value, at which point
29+
it emits the buffer on the output Observable and starts a new buffer internally,
30+
awaiting the next time <span class="markdown-code">closingNotifier</span> emits.
31+
</p>
32+
`
33+
},
34+
examples: [
35+
{
36+
name: 'On every click, emit array of most recent interval events',
37+
code: `
38+
const clicks = Rx.Observable.fromEvent(document, 'click');
39+
const interval = Rx.Observable.interval(1000);
40+
const buffered = interval.buffer(clicks);
41+
buffered.subscribe(x => console.log(x));
42+
`,
43+
externalLink: {
44+
platform: 'JSBin',
45+
url: 'http://jsbin.com/xetemuteho/embed?js,console,output'
46+
}
47+
}
48+
],
49+
relatedOperators: [
50+
'bufferCount',
51+
'bufferTime',
52+
'bufferToggle',
53+
'bufferWhen',
54+
'window'
55+
],
56+
additionalResources: []
657
};

0 commit comments

Comments
 (0)