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 Subscriber_1 = require("./Subscriber");
17 var Observable_1 = require("./Observable");
18 var subscribeTo_1 = require("./util/subscribeTo");
19 var SimpleInnerSubscriber = (function (_super) {
20 __extends(SimpleInnerSubscriber, _super);
21 function SimpleInnerSubscriber(parent) {
22 var _this = _super.call(this) || this;
23 _this.parent = parent;
26 SimpleInnerSubscriber.prototype._next = function (value) {
27 this.parent.notifyNext(value);
29 SimpleInnerSubscriber.prototype._error = function (error) {
30 this.parent.notifyError(error);
33 SimpleInnerSubscriber.prototype._complete = function () {
34 this.parent.notifyComplete();
37 return SimpleInnerSubscriber;
38 }(Subscriber_1.Subscriber));
39 exports.SimpleInnerSubscriber = SimpleInnerSubscriber;
40 var ComplexInnerSubscriber = (function (_super) {
41 __extends(ComplexInnerSubscriber, _super);
42 function ComplexInnerSubscriber(parent, outerValue, outerIndex) {
43 var _this = _super.call(this) || this;
44 _this.parent = parent;
45 _this.outerValue = outerValue;
46 _this.outerIndex = outerIndex;
49 ComplexInnerSubscriber.prototype._next = function (value) {
50 this.parent.notifyNext(this.outerValue, value, this.outerIndex, this);
52 ComplexInnerSubscriber.prototype._error = function (error) {
53 this.parent.notifyError(error);
56 ComplexInnerSubscriber.prototype._complete = function () {
57 this.parent.notifyComplete(this);
60 return ComplexInnerSubscriber;
61 }(Subscriber_1.Subscriber));
62 exports.ComplexInnerSubscriber = ComplexInnerSubscriber;
63 var SimpleOuterSubscriber = (function (_super) {
64 __extends(SimpleOuterSubscriber, _super);
65 function SimpleOuterSubscriber() {
66 return _super !== null && _super.apply(this, arguments) || this;
68 SimpleOuterSubscriber.prototype.notifyNext = function (innerValue) {
69 this.destination.next(innerValue);
71 SimpleOuterSubscriber.prototype.notifyError = function (err) {
72 this.destination.error(err);
74 SimpleOuterSubscriber.prototype.notifyComplete = function () {
75 this.destination.complete();
77 return SimpleOuterSubscriber;
78 }(Subscriber_1.Subscriber));
79 exports.SimpleOuterSubscriber = SimpleOuterSubscriber;
80 var ComplexOuterSubscriber = (function (_super) {
81 __extends(ComplexOuterSubscriber, _super);
82 function ComplexOuterSubscriber() {
83 return _super !== null && _super.apply(this, arguments) || this;
85 ComplexOuterSubscriber.prototype.notifyNext = function (_outerValue, innerValue, _outerIndex, _innerSub) {
86 this.destination.next(innerValue);
88 ComplexOuterSubscriber.prototype.notifyError = function (error) {
89 this.destination.error(error);
91 ComplexOuterSubscriber.prototype.notifyComplete = function (_innerSub) {
92 this.destination.complete();
94 return ComplexOuterSubscriber;
95 }(Subscriber_1.Subscriber));
96 exports.ComplexOuterSubscriber = ComplexOuterSubscriber;
97 function innerSubscribe(result, innerSubscriber) {
98 if (innerSubscriber.closed) {
101 if (result instanceof Observable_1.Observable) {
102 return result.subscribe(innerSubscriber);
104 return subscribeTo_1.subscribeTo(result)(innerSubscriber);
106 exports.innerSubscribe = innerSubscribe;
107 //# sourceMappingURL=innerSubscribe.js.map