@fabrix/spool-realtime
Version:
Spool: Realtime, Synchronize the client and server via WebSockets using Primus
32 lines • 900 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const common_1 = require("@fabrix/fabrix/dist/common");
class Spark extends common_1.FabrixGeneric {
constructor() {
super(...arguments);
this._sparks = new Map();
}
get sparks() {
return this._sparks;
}
getSpark(key) {
return this._sparks.get(key);
}
addSpark(key, spark) {
return this._sparks.set(key, spark);
}
removeSpark(key) {
return this._sparks.delete(key);
}
connection(spark) {
throw new Error('Connection should be overwritten by sub class!');
}
data(spark) {
throw new Error('Data should be overwritten by sub class!');
}
disconnection(spark) {
throw new Error('Disconnection should be overwritten by sub class!');
}
}
exports.Spark = Spark;
//# sourceMappingURL=Spark.js.map