@coorpacademy/progression-engine
Version:
29 lines (28 loc) • 776 B
JavaScript
;
exports.__esModule = true;
exports.default = void 0;
var _applyInstructions = _interopRequireDefault(require("../rule-engine/apply-instructions"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
const variables = config => (_state, action) => {
const state = _state.variables ? _state : {
..._state,
variables: {}
};
switch (action.type) {
case 'answer':
case 'move':
{
const {
instructions
} = action.payload;
if (!instructions) return state;
return (0, _applyInstructions.default)(instructions)(state);
}
default:
{
return state;
}
}
};
var _default = exports.default = variables;
//# sourceMappingURL=variables.js.map