use-reducer-middlewares
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

use-reducer-middlewares

enhance React Hooks API useReducer can use middleware.

NPM Build Status minified license coverage

Install

// use yarn
yarn add use-reducer-middlewares
// use npm
npm install use-reducer-middlewares

Demo

import useMiddleWares from 'use-reducer-middlewares'
import logger from 'redux-logger'
 
const reducer = function (state, action) {
  // reducer
  return state
}
 
const init = function(count) {
  return {count}
}
 
const [state, dispatch] = useMiddleWares(reducer, 1, init)([
  logger
]);

Sandbox Demo

(Code Sandbox Demo)[https://codesandbox.io/s/wk3o2jp1ll]

Readme

Keywords

none

Package Sidebar

Install

npm i use-reducer-middlewares

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

4.42 MB

Total Files

27

Last publish

Collaborators

  • ariesjia