This repository has been archived on 2022-03-12. You can view files and clone it, but cannot push or open issues or pull requests.
2021-04-02 02:24:13 +03:00

19 lines
599 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class StateManager {
constructor(state) {
this.state = state;
// @ts-ignore
this.appliedActions = {};
// @ts-ignore
this.applyAction = action => {
const [state, actionName, appliedAction] = action(this.state, this.appliedActions);
this.state = state;
// @ts-ignore
this.appliedActions[actionName] = appliedAction;
return this;
};
}
}
exports.default = StateManager;
//# sourceMappingURL=StateManager.js.map