Sha256: 6eaa427ec84ac63ebb949f177f0d082c2e9c89334db88cbba2b1e3bf5a64dc63
Contents?: true
Size: 972 Bytes
Versions: 14
Compression:
Stored size: 972 Bytes
Contents
/** * Returns an array with the specified number of contiguous elements from the end of an observable sequence. * * @description * This operator accumulates a buffer with a length enough to store count elements. Upon completion of the * source sequence, this buffer is produced on the result sequence. * @param {Number} count Number of elements to take from the end of the source sequence. * @returns {Observable} An observable sequence containing a single array with the specified number of elements from the end of the source sequence. */ observableProto.takeLastBuffer = function (count) { var source = this; return new AnonymousObservable(function (o) { var q = []; return source.subscribe(function (x) { q.push(x); q.length > count && q.shift(); }, function (e) { o.onError(e); }, function () { o.onNext(q); o.onCompleted(); }); }, source); };
Version data entries
14 entries across 7 versions & 1 rubygems