code-workshop-kit
Version:
The future of remote code workshops & training
25 lines • 809 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.cwkState = void 0;
const deepmerge_1 = __importDefault(require("deepmerge"));
const is_plain_object_1 = __importDefault(require("is-plain-object"));
class CwkStateSingleton {
constructor() {
this.__data = {};
}
get state() {
return this.__data;
}
set state(value) {
this.__data = deepmerge_1.default(this.__data, value, { isMergeableObject: is_plain_object_1.default });
}
clear() {
this.__data = {};
}
}
const cwkState = new CwkStateSingleton();
exports.cwkState = cwkState;
//# sourceMappingURL=CwkStateSingleton.js.map