Proxy in a provider #913
naghinezhad
started this conversation in
General
Replies: 1 comment
-
@rrousselGit Could you help me, please? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Is this the correct way to proxy a provider?
I want some providers to act like proxies and reset their internal state when the
isAuthenticated
status inAuthProvider
changes.The scenario is: when the user logs in (
isAuthenticated == true
), everything works normally. But when the user logs out (isAuthenticated == false
), I want the dependent providers to reset.I've implemented this using
ChangeNotifierProxyProvider
, but I'm not sure if it's correct. I’d appreciate any feedback or suggestions.Is this a valid approach for resetting providers when the user logs out?
Is there a cleaner or better way to achieve this?
Is this solution safe and efficient for production use?
Beta Was this translation helpful? Give feedback.
All reactions