.
This commit is contained in:
22
node_modules/rxjs/dist/esm/internal/operators/buffer.js
generated
vendored
Normal file
22
node_modules/rxjs/dist/esm/internal/operators/buffer.js
generated
vendored
Normal file
@@ -0,0 +1,22 @@
|
||||
import { operate } from '../util/lift';
|
||||
import { noop } from '../util/noop';
|
||||
import { createOperatorSubscriber } from './OperatorSubscriber';
|
||||
import { innerFrom } from '../observable/innerFrom';
|
||||
export function buffer(closingNotifier) {
|
||||
return operate((source, subscriber) => {
|
||||
let currentBuffer = [];
|
||||
source.subscribe(createOperatorSubscriber(subscriber, (value) => currentBuffer.push(value), () => {
|
||||
subscriber.next(currentBuffer);
|
||||
subscriber.complete();
|
||||
}));
|
||||
innerFrom(closingNotifier).subscribe(createOperatorSubscriber(subscriber, () => {
|
||||
const b = currentBuffer;
|
||||
currentBuffer = [];
|
||||
subscriber.next(b);
|
||||
}, noop));
|
||||
return () => {
|
||||
currentBuffer = null;
|
||||
};
|
||||
});
|
||||
}
|
||||
//# sourceMappingURL=buffer.js.map
|
||||
Reference in New Issue
Block a user