1 /** PURE_IMPORTS_START tslib,_Subject,_Subscription PURE_IMPORTS_END */
2 import * as tslib_1 from "tslib";
3 import { Subject } from './Subject';
4 import { Subscription } from './Subscription';
5 var AsyncSubject = /*@__PURE__*/ (function (_super) {
6 tslib_1.__extends(AsyncSubject, _super);
7 function AsyncSubject() {
8 var _this = _super !== null && _super.apply(this, arguments) || this;
10 _this.hasNext = false;
11 _this.hasCompleted = false;
14 AsyncSubject.prototype._subscribe = function (subscriber) {
16 subscriber.error(this.thrownError);
17 return Subscription.EMPTY;
19 else if (this.hasCompleted && this.hasNext) {
20 subscriber.next(this.value);
21 subscriber.complete();
22 return Subscription.EMPTY;
24 return _super.prototype._subscribe.call(this, subscriber);
26 AsyncSubject.prototype.next = function (value) {
27 if (!this.hasCompleted) {
32 AsyncSubject.prototype.error = function (error) {
33 if (!this.hasCompleted) {
34 _super.prototype.error.call(this, error);
37 AsyncSubject.prototype.complete = function () {
38 this.hasCompleted = true;
40 _super.prototype.next.call(this, this.value);
42 _super.prototype.complete.call(this);
46 export { AsyncSubject };
47 //# sourceMappingURL=AsyncSubject.js.map