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

Dispatch actions on subscription callback #11

Closed
tol-is opened this issue Sep 19, 2018 · 1 comment
Closed

Dispatch actions on subscription callback #11

tol-is opened this issue Sep 19, 2018 · 1 comment

Comments

@tol-is
Copy link

tol-is commented Sep 19, 2018

I needed this library for a side project recently, but in my case, I needed to dispatch an action when the subscription callback is invoked.

Also because I was using redux-thunk extensively, I would like to have a similar convention where the callback receives via arguments, the dispatcher and state.

Because of that, I didn't want to make a pull request, but if you want to have a look and let me know what you think, I could continue working towards a PR.

https://github.com/tol-is/redux-subscriber

@ivantsov
Copy link
Owner

Hey @tol-is, I'd encourage you to check this issue - #8. There I explained that dispatching actions inside subscriber callback is not a good idea. That's why I'd like not to support it in the lib.
However, if you have a usecase when you can't overcome this limitation by amending your redux-actions - please share the example and I'll try to help you.

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

2 participants