Skip to content
enhance React Hooks API `useReducer` can use middleware
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.storybook
src
test/unit
.gitignore
.huskyrc
.npmignore
.travis.yml
LICENSE
README.md
commitlint.config.js
package.json
tsconfig.json
yarn.lock

README.md

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]

You can’t perform that action at this time.