Skip to content
This repository was archived by the owner on Oct 1, 2018. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 53 additions & 2 deletions src/operator-docs/transformation/buffer.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,57 @@
import { OperatorDoc } from '../operator.model';

export const buffer: OperatorDoc = {
'name': 'buffer',
'operatorType': 'transformation'
name: 'buffer',
operatorType: 'transformation',
signature: 'public buffer(closingNotifier: Observable): Observable',
useInteractiveMarbles: true,
parameters: [
{
name: 'closingNotifier',
type: 'Observable',
attribute: '',
description:
'An Observable that signals the buffer to be emitted on the output Observable.'
}
],
marbleUrl: 'http://reactivex.io/rxjs/img/buffer.png',
shortDescription: {
description: `
Buffers the source Observable values until <span class="markdown-code">closingNotifier</span>
emits.
`
},
walkthrough: {
description: `
<p>
Buffers the incoming Observable values until the given
<span class="markdown-code">closingNotifier</span> Observable emits a value, at which point
it emits the buffer on the output Observable and starts a new buffer internally,
awaiting the next time <span class="markdown-code">closingNotifier</span> emits.
</p>
`
},
examples: [
{
name: 'On every click, emit array of most recent interval events',
code: `
const clicks = Rx.Observable.fromEvent(document, 'click');
const interval = Rx.Observable.interval(1000);
const buffered = interval.buffer(clicks);
buffered.subscribe(x => console.log(x));
`,
externalLink: {
platform: 'JSBin',
url: 'http://jsbin.com/xetemuteho/embed?js,console,output'
}
}
],
relatedOperators: [
'bufferCount',
'bufferTime',
'bufferToggle',
'bufferWhen',
'window'
],
additionalResources: []
};