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

Results accumulating on store.observer call #100

Open
LuizFelipeMisseno opened this issue Nov 28, 2022 · 2 comments
Open

Results accumulating on store.observer call #100

LuizFelipeMisseno opened this issue Nov 28, 2022 · 2 comments
Labels
question Further information is requested

Comments

@LuizFelipeMisseno
Copy link

Hello, thank you for the package.
I have a doubt about behavior of the store.observer, why is it accumulating the results?
The first time I call the method, it returns nothing, the second time it returns once, the third time it returns twice and so on.

I may be missunderstanding the behavior of the method, but I expected it to only return the result once, because if I call a showDialog for example, I don't want it to be called 2, 3, 4.. times, just once.

image

This screenshot is the result, as you can see the number of results increases as I call the function.

@tauamendonca tauamendonca added the question Further information is requested label Dec 30, 2022
@tauamendonca
Copy link
Contributor

Could you please provide part of the code or any other insight about your implementation?

@rodrigodittrich
Copy link

Disposer? disposer;

@override
void initState() {
    super.initState();
    disposer = controller.observer(
       onState: (state) => onState(state)
  );
}

@override
 void dispose() {
    disposer!.call();
    super.dispose();
 }

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

No branches or pull requests

3 participants