@rxx/core
Version:
React MVI micro framework.
15 lines (14 loc) • 557 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function generateIntentHandler(intent, subject) {
var intentCallable = function (key, args) {
intent.push(key, args);
subject.notify({ type: key, payload: args });
};
intentCallable.callback = function (k, v, fix) {
if (fix === void 0) { fix = false; }
return function (nv) { return intentCallable(k, !fix ? (nv !== undefined ? nv : v) : v); };
};
return intentCallable;
}
exports.generateIntentHandler = generateIntentHandler;