redux-use-controller
TypeScript icon, indicating that this package has built-in type declarations

1.0.5 • Public • Published

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>
  );
}

Package Sidebar

Install

npm i redux-use-controller

Weekly Downloads

2

Version

1.0.5

License

MIT

Unpacked Size

10.9 kB

Total Files

7

Last publish

Collaborators

  • tabun80