Last change
on this file since 8d391a1 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[6a3a178] | 1 | /** PURE_IMPORTS_START tslib,_Subscriber PURE_IMPORTS_END */
|
---|
| 2 | import * as tslib_1 from "tslib";
|
---|
| 3 | import { Subscriber } from '../Subscriber';
|
---|
| 4 | export function skip(count) {
|
---|
| 5 | return function (source) { return source.lift(new SkipOperator(count)); };
|
---|
| 6 | }
|
---|
| 7 | var SkipOperator = /*@__PURE__*/ (function () {
|
---|
| 8 | function SkipOperator(total) {
|
---|
| 9 | this.total = total;
|
---|
| 10 | }
|
---|
| 11 | SkipOperator.prototype.call = function (subscriber, source) {
|
---|
| 12 | return source.subscribe(new SkipSubscriber(subscriber, this.total));
|
---|
| 13 | };
|
---|
| 14 | return SkipOperator;
|
---|
| 15 | }());
|
---|
| 16 | var SkipSubscriber = /*@__PURE__*/ (function (_super) {
|
---|
| 17 | tslib_1.__extends(SkipSubscriber, _super);
|
---|
| 18 | function SkipSubscriber(destination, total) {
|
---|
| 19 | var _this = _super.call(this, destination) || this;
|
---|
| 20 | _this.total = total;
|
---|
| 21 | _this.count = 0;
|
---|
| 22 | return _this;
|
---|
| 23 | }
|
---|
| 24 | SkipSubscriber.prototype._next = function (x) {
|
---|
| 25 | if (++this.count > this.total) {
|
---|
| 26 | this.destination.next(x);
|
---|
| 27 | }
|
---|
| 28 | };
|
---|
| 29 | return SkipSubscriber;
|
---|
| 30 | }(Subscriber));
|
---|
| 31 | //# sourceMappingURL=skip.js.map
|
---|
Note:
See
TracBrowser
for help on using the repository browser.