This repository has been archived on 2025-05-09. You can view files and clone it, but cannot push or open issues or pull requests.
Chika 9cf409df2c refactor(calculationstore): import actions dynamically
remove actions from calculationStore and import in component dynamically
2021-04-27 13:19:40 +03:00

13 lines
318 B
JavaScript

import { action as resolveAction } from 'core/tools/resolve';
export const useAction = ({ actionName }) => {
const action = () => {
resolveAction({ storeName: 'CalculationStore', actionName }).then(
({ default: resolvedAction }) => {
resolvedAction();
},
);
};
return { action };
};