remove actions.todo

This commit is contained in:
Yanick Champoux 2023-03-11 16:47:26 -05:00
parent 5edbc688be
commit 17cd3bec46

View File

@ -1,26 +0,0 @@
export function isActionGen(action) {
return typeof action === 'function' && action.type;
}
export function action(type, payloadFunction, transformer) {
let generator = function (...payloadArg) {
const result = { type };
if (payloadFunction) {
result.payload = payloadFunction(...payloadArg);
} else {
if (payloadArg[0] !== undefined) result.payload = payloadArg[0];
}
return result;
};
if (transformer) {
const orig = generator;
generator = (...args) => transformer(orig(...args), args);
}
generator.type = type;
return generator;
}