@moxb/meteor
Advanced tools
Comparing version 0.2.0-beta.10 to 0.2.0-beta.11
@@ -12,1 +12,3 @@ export * from './MeteorCall'; | ||
export * from './QueryStringParser'; | ||
export * from './MeteorMethod'; | ||
export * from './MeteorAction'; |
@@ -11,2 +11,4 @@ "use strict"; | ||
tslib_1.__exportStar(require("./QueryStringParser"), exports); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsdURBQTZCO0FBRzdCLCtEQUFxQztBQUNyQyxtRUFBeUM7QUFHekMsNERBQWtDO0FBQ2xDLG1FQUF5QztBQUN6QyxrRUFBd0M7QUFDeEMsOERBQW9DIn0= | ||
tslib_1.__exportStar(require("./MeteorMethod"), exports); | ||
tslib_1.__exportStar(require("./MeteorAction"), exports); | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsdURBQTZCO0FBRzdCLCtEQUFxQztBQUNyQyxtRUFBeUM7QUFHekMsNERBQWtDO0FBQ2xDLG1FQUF5QztBQUN6QyxrRUFBd0M7QUFDeEMsOERBQW9DO0FBQ3BDLHlEQUErQjtBQUMvQix5REFBK0IifQ== |
@@ -9,2 +9,5 @@ export interface MeteorSubscription { | ||
readonly isSubscriptionReady: boolean; | ||
readonly hasFailed: boolean; | ||
readonly error?: any; | ||
readonly pending: boolean; | ||
} |
@@ -5,2 +5,4 @@ import { MeteorSubscription } from './MeteorSubscription'; | ||
private _isSubscriptionReady; | ||
private _hasFailed; | ||
private _error?; | ||
private subscriptionTracker?; | ||
@@ -15,2 +17,8 @@ private mobxAutoRun?; | ||
isSubscriptionReady: boolean; | ||
readonly hasFailed: boolean; | ||
readonly error: any; | ||
readonly pending: boolean; | ||
protected _fail(error: any): void; | ||
private _publicationName?; | ||
protected meteorSubscribe(publicationName: string, ...args: any[]): Meteor.SubscriptionHandle; | ||
private subscribe; | ||
@@ -17,0 +25,0 @@ private unsubscribe; |
@@ -11,2 +11,3 @@ "use strict"; | ||
this._isSubscriptionReady = false; | ||
this._hasFailed = false; | ||
mobx_1.onBecomeObserved(this, '_isSubscriptionReady', function () { | ||
@@ -20,2 +21,3 @@ // console.log('subscribe=', this.constructor.name); | ||
}); | ||
this._fail = this._fail.bind(this); | ||
} | ||
@@ -36,4 +38,42 @@ Object.defineProperty(MeteorSubscriptionImpl.prototype, "isSubscriptionReady", { | ||
}); | ||
Object.defineProperty(MeteorSubscriptionImpl.prototype, "hasFailed", { | ||
get: function () { | ||
return this._hasFailed; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(MeteorSubscriptionImpl.prototype, "error", { | ||
get: function () { | ||
return this._error; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
Object.defineProperty(MeteorSubscriptionImpl.prototype, "pending", { | ||
get: function () { | ||
return !this._isSubscriptionReady && !this._hasFailed; | ||
}, | ||
enumerable: true, | ||
configurable: true | ||
}); | ||
MeteorSubscriptionImpl.prototype._fail = function (error) { | ||
if (error) { | ||
// console.warn('Failing subscription', this._publicationName, ':', error); | ||
this._hasFailed = true; | ||
this._error = error; | ||
} | ||
}; | ||
MeteorSubscriptionImpl.prototype.meteorSubscribe = function (publicationName) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
this._publicationName = publicationName; | ||
return Meteor.subscribe.apply(Meteor, [publicationName].concat(args, [{ onStop: this._fail }])); | ||
}; | ||
MeteorSubscriptionImpl.prototype.subscribe = function () { | ||
var _this = this; | ||
this._error = undefined; | ||
this._hasFailed = false; | ||
this.nSubscriptions++; | ||
@@ -92,2 +132,8 @@ if (this.nSubscriptions === 1 && this.mobxAutoRun == undefined) { | ||
tslib_1.__decorate([ | ||
mobx_1.observable | ||
], MeteorSubscriptionImpl.prototype, "_hasFailed", void 0); | ||
tslib_1.__decorate([ | ||
mobx_1.observable | ||
], MeteorSubscriptionImpl.prototype, "_error", void 0); | ||
tslib_1.__decorate([ | ||
mobx_1.action.bound | ||
@@ -104,2 +150,2 @@ ], MeteorSubscriptionImpl.prototype, "subscribe", null); | ||
exports.MeteorSubscriptionImpl = MeteorSubscriptionImpl; | ||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWV0ZW9yU3Vic2NyaXB0aW9uSW1wbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9NZXRlb3JTdWJzY3JpcHRpb25JbXBsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUNBLDZCQUE0RztBQUM1RywyREFBcUQ7QUFHckQ7SUFTSTtRQUFBLGlCQVNDO1FBaEJPLG1CQUFjLEdBQUcsQ0FBQyxDQUFDO1FBRW5CLHlCQUFvQixHQUFHLEtBQUssQ0FBQztRQU1qQyx1QkFBZ0IsQ0FBQyxJQUFJLEVBQUUsc0JBQXNCLEVBQUU7WUFDM0Msb0RBQW9EO1lBQ3BELEtBQUksQ0FBQyxTQUFTLEVBQUUsQ0FBQztRQUNyQixDQUFDLENBQUMsQ0FBQztRQUNILHlCQUFrQixDQUFDLElBQUksRUFBRSxzQkFBc0IsRUFBRTtZQUM3QyxzREFBc0Q7WUFDdEQsS0FBSSxDQUFDLFdBQVcsRUFBRSxDQUFDO1FBQ3ZCLENBQUMsQ0FBQyxDQUFDO0lBQ1AsQ0FBQztJQU1ELHNCQUFJLHVEQUFtQjtRQUp2Qjs7O1dBR0c7YUFDSDtZQUNJLE9BQU8sSUFBSSxDQUFDLG9CQUFvQix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QzthQUNoQztZQUNELElBQUksSUFBSSxDQUFDLGFBQWEsRUFBRTtnQkFDcEIsWUFBWSxDQUFDLElBQUksQ0FBQyxhQUFhLENBQUMsQ0FBQztnQkFDakMsSUFBSSxDQUFDLGFBQWEsR0FBRyxTQUFTLENBQUM7YUFDbEM7U0FDSjtJQUNMLENBQUM7SUFHTyxxREFBb0IsR0FBNUIsVUFBNkIsT0FBZ0I7UUFDekMsSUFBSSxDQUFDLG9CQUFvQixHQUFHLE9BQU8sQ0FBQztJQUN4QyxDQUFDO0lBN0dEO1FBREMsaUJBQVU7a0VBQ2dCO0lBRTNCO1FBREMsaUJBQVU7d0VBQzBCO0lBRXJDO1FBREMsaUJBQVU7OERBQ2dCO0lBRTNCO1FBREMsaUJBQVU7MERBQ1U7SUFvRHJCO1FBREMsYUFBTSxDQUFDLEtBQUs7MkRBMEJaO0lBR0Q7UUFEQyxhQUFNLENBQUMsS0FBSzs2REFtQlo7SUFHRDtRQURDLGFBQU0sQ0FBQyxLQUFLO3NFQUdaO0lBWUwsNkJBQUM7Q0FBQSxBQTNIRCxJQTJIQztBQTNIcUIsd0RBQXNCIn0= |
{ | ||
"name": "@moxb/meteor", | ||
"version": "0.2.0-beta.10", | ||
"version": "0.2.0-beta.11", | ||
"description": "MobX meteor binding", | ||
@@ -50,3 +50,3 @@ "scripts": { | ||
"devDependencies": { | ||
"@moxb/moxb": "^0.2.0-beta.10", | ||
"@moxb/moxb": "^0.2.0-beta.11", | ||
"@types/jest": "^23.3.1", | ||
@@ -57,3 +57,3 @@ "@types/meteor": "^1.4.16", | ||
}, | ||
"gitHead": "9f5725c4b30261cd22ea2a4c27ea863525d0b53f" | ||
"gitHead": "4fb2b11f446e8e3f450465f35dcd69cc3f471fdf" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
126080
34
1909