UNPKG

better-npm-init

Version:

A better version of npm init, with templates and more. Usage: better-npm-init <template> [--yarn] [--install] [--git] [--yes] [--help]

21 lines 812 B
import { operate } from '../util/lift'; import { noop } from '../util/noop'; import { createOperatorSubscriber } from './OperatorSubscriber'; export function buffer(closingNotifier) { return operate(function (source, subscriber) { var currentBuffer = []; source.subscribe(createOperatorSubscriber(subscriber, function (value) { return currentBuffer.push(value); }, function () { subscriber.next(currentBuffer); subscriber.complete(); })); closingNotifier.subscribe(createOperatorSubscriber(subscriber, function () { var b = currentBuffer; currentBuffer = []; subscriber.next(b); }, noop)); return function () { currentBuffer = null; }; }); } //# sourceMappingURL=buffer.js.map