Need advice: Is this a correct way to invalidate all providers using listen? #3782
Unanswered
thanhdatvo
asked this question in
Q&A
Replies: 2 comments 2 replies
-
|
@rrousselGit Could you please take some time to review my example and provide your feedback? It will help my team a lot. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Why don't you just create a function and put all ref.invalidate(provider) you need into that funtion? In my opinion, we usually depend on a token. So I will create a userProvider and watch it in every provider where I need it. This way, if my userProvider changes, all providers that depend on it will change as well |
Beta Was this translation helpful? Give feedback.
2 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.
Uh oh!
There was an error while loading. Please reload this page.
-
I invented a way to invalidate all providers.
Firstly, I create a _resetProvider
Then I make responseProvider subscribe to this provider
And when user logs out, I could reset responseProvider with this
I want to hear your opinions on this approach.
Thanks,
Beta Was this translation helpful? Give feedback.
All reactions