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

Use GoRouter.refreshListenable #35

Open
torbenkeller opened this issue Nov 25, 2023 · 1 comment
Open

Use GoRouter.refreshListenable #35

torbenkeller opened this issue Nov 25, 2023 · 1 comment

Comments

@torbenkeller
Copy link

GoRouter can get a listenable and refreshes if the listenable notifies the router. In your code you are not using it, but I think it would be the better way to do it. You are listening to the current auth state and rebuild the whole router on a change. The state remains intact because of the global key, but this is probably more expensive than creating a listenable and let GoRouter refresh itself.

@lucavenir
Copy link
Owner

Thank you for raising this issue. It was not intended to rebuild the whole router provider, so I'm guessing I wrote a ref.watch instead of a ref.listen.

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