pushinka
Version:
Pushinka: Transactional, Reactive, and Asynchronous State Management
31 lines • 931 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
var XMonitor = (function () {
function XMonitor() {
this.idle = true;
this.workers = 0;
}
Object.defineProperty(XMonitor.prototype, "isIdle", {
get: function () { return this.idle; },
enumerable: true,
configurable: true
});
Object.defineProperty(XMonitor.prototype, "workerCount", {
get: function () { return this.workers; },
enumerable: true,
configurable: true
});
XMonitor.prototype.enter = function () {
if (this.workers === 0)
this.idle = false;
this.workers++;
};
XMonitor.prototype.leave = function () {
this.workers--;
if (this.workers === 0)
this.idle = true;
};
return XMonitor;
}());
exports.XMonitor = XMonitor;
//# sourceMappingURL=Monitor.js.map