@state-sync/redux-path-reducer
Version:
state-sync client only json path reducer
72 lines (71 loc) • 2.6 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
/**
* Request message sent by client. Server must respond with one of response messages.
*/
var RequestMessage = /** @class */ (function () {
/**
* Construct new request message
* @param {number} id request identifier
* @param {string} type request type
*/
function RequestMessage(id, type) {
this.id = id;
this.type = type;
}
return RequestMessage;
}());
exports.RequestMessage = RequestMessage;
var SubscribeAreaRequest = /** @class */ (function (_super) {
__extends(SubscribeAreaRequest, _super);
function SubscribeAreaRequest(id, area) {
var _this = _super.call(this, id, 'subscribeArea') || this;
_this.area = area;
return _this;
}
return SubscribeAreaRequest;
}(RequestMessage));
exports.SubscribeAreaRequest = SubscribeAreaRequest;
var PatchAreaRequest = /** @class */ (function (_super) {
__extends(PatchAreaRequest, _super);
function PatchAreaRequest(id, area, patch) {
var _this = _super.call(this, id, 'p') || this;
_this.area = area;
_this.patch = patch;
return _this;
}
return PatchAreaRequest;
}(RequestMessage));
exports.PatchAreaRequest = PatchAreaRequest;
var SignalRequest = /** @class */ (function (_super) {
__extends(SignalRequest, _super);
function SignalRequest(id, area, signal, parameters) {
var _this = _super.call(this, id, 'signal') || this;
_this.area = area;
_this.signal = signal;
_this.parameters = parameters;
return _this;
}
return SignalRequest;
}(RequestMessage));
exports.SignalRequest = SignalRequest;
var UnsubscribeAreaRequest = /** @class */ (function (_super) {
__extends(UnsubscribeAreaRequest, _super);
function UnsubscribeAreaRequest(id, area) {
var _this = _super.call(this, id, 'unsubscribeArea') || this;
_this.area = area;
return _this;
}
return UnsubscribeAreaRequest;
}(RequestMessage));
exports.UnsubscribeAreaRequest = UnsubscribeAreaRequest;