2 var __extends = (this && this.__extends) || (function () {
3 var extendStatics = function (d, b) {
4 extendStatics = Object.setPrototypeOf ||
5 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
6 function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
7 return extendStatics(d, b);
9 return function (d, b) {
11 function __() { this.constructor = d; }
12 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
15 Object.defineProperty(exports, "__esModule", { value: true });
16 var innerSubscribe_1 = require("../innerSubscribe");
17 function sample(notifier) {
18 return function (source) { return source.lift(new SampleOperator(notifier)); };
20 exports.sample = sample;
21 var SampleOperator = (function () {
22 function SampleOperator(notifier) {
23 this.notifier = notifier;
25 SampleOperator.prototype.call = function (subscriber, source) {
26 var sampleSubscriber = new SampleSubscriber(subscriber);
27 var subscription = source.subscribe(sampleSubscriber);
28 subscription.add(innerSubscribe_1.innerSubscribe(this.notifier, new innerSubscribe_1.SimpleInnerSubscriber(sampleSubscriber)));
31 return SampleOperator;
33 var SampleSubscriber = (function (_super) {
34 __extends(SampleSubscriber, _super);
35 function SampleSubscriber() {
36 var _this = _super !== null && _super.apply(this, arguments) || this;
37 _this.hasValue = false;
40 SampleSubscriber.prototype._next = function (value) {
44 SampleSubscriber.prototype.notifyNext = function () {
47 SampleSubscriber.prototype.notifyComplete = function () {
50 SampleSubscriber.prototype.emitValue = function () {
52 this.hasValue = false;
53 this.destination.next(this.value);
56 return SampleSubscriber;
57 }(innerSubscribe_1.SimpleOuterSubscriber));
58 //# sourceMappingURL=sample.js.map