redux-use-controller
v1.0.5
Published
Redux useController =========================
Downloads
4
Maintainers
Readme
Redux useController
Installation
npm i redux-use-controller
Usage
Controller
const testController = (dispatch, props) => {
const testUseCase = new TestUseCase();
const payload = testUseCase.test();
dispatch({ type: 'TEST', payload })
}
React Functional Component
const MyButton = () => {
const executeTest = useController(testController);
return (
<button onClick={executeTest}>test</button>
);
}