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

StoreConnector callbacks are duplicated and pile up after hot reloads #92

Closed
nashfive opened this issue Dec 20, 2018 · 2 comments
Closed

Comments

@nashfive
Copy link

Hi @brianegan,
I have an issue with the StoreConnector. I am not sure that it is related entirely to Flutter Redux, but I have a StoreConnector in a stateful widget, with an onInit callback in which I dispatch a few actions on the store.
The issue occurs after the first hot reload: the onInit callback is called twice. In fact every time a hot reload occurs, it adds another call so I quickly end up with many duplicate calls/actions.
I can't find the reason why, it must be obvious but I have no idea where to start looking for a hint. The flutter inspector?

@nashfive
Copy link
Author

Hmm after putting breakpoints and print statements, the callback is always called once, but the statements in the callback are duplicated after the first hot reload (?!)

@brianegan
Copy link
Owner

brianegan commented Jan 7, 2019

Hey there -- I took a look at this and couldn't see it printing multiple statements, but I have seen the Flutter tools report old Logs before. I'm going to tentatively close this out for now since I have tests verifying the code is only called once, but let's keep an eye on it.

The only other thing that could cause this: Are you providing a new, unique key to the StoreConnector widget on each build?

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