Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EnhanceComponent doesn't work with thunk middleware #84

Open
dfedynich opened this issue Jun 9, 2017 · 0 comments
Open

EnhanceComponent doesn't work with thunk middleware #84

dfedynich opened this issue Jun 9, 2017 · 0 comments

Comments

@dfedynich
Copy link

dfedynich commented Jun 9, 2017

Hey, team. As far as I know, EnhanceComponent makes monkey patching for dispatch method to allow wrapping dispatched actions. Here is the patch

const dispatch = (action) =>
        store.dispatch({
          ...action,
          type: wrapper(action.type)
        })

But how can we work with thunks, when a function is dispatched instead of an action? Could you provide a general solution to work with this kind of middleware?
Do we need to change EnhanceComponent source code each time, when we want to support custom middleware?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant