pelotom / use-methods

A simpler way to useReducers
MIT License
705 stars 22 forks source link

Provide custom "useReducer" hook #27

Open alonfai opened 4 years ago

alonfai commented 4 years ago

Hi @pelotom ,

I want to suggest adding support for providing a custom "useReducer" hook inside the useMethods function, which adds supports to other middlewares, not just the default that came with the "react" module. I saw this project "reinspect" https://github.com/troch/reinspect , which provides integration with the redux-devtools extension for time travel debugging, something I used a lot with Redux before switching to context API and the hooks ecosystem.

I suggest adding a PR that will have a "useReducer" function as part of the useMethods hook, that will be optional by default and use the default "useReducer" from 'react' package.

Happy to contribute for this if needed.

pelotom commented 4 years ago

Hi @alonfai, this makes sense and I'd be happy to take a PR.

gregoryforel commented 4 years ago

Hi @alonfai, have you submitted the PR? It's indeed a great idea.