useObservable deps being negated by preloadObservable #256
Replies: 3 comments
-
I've been playing with this a little and I feel that this may be causing #228. Internally, the observable is created with a document ID (as an example) and when a user logs in, then logs out, then logs in - the old observable is used again and throws an error. Perhaps there needs to be cleanup on |
Beta Was this translation helpful? Give feedback.
-
I'll take a look in your case after work. But I think what they do with "caching" the observable is maybe a good thing. |
Beta Was this translation helpful? Give feedback.
-
I definitely agree that caching makes sense - the issue is more that cached observable fails if the user logs out and then back in. Right now I'm manually cleaning up the cached observables to try to solve that. |
Beta Was this translation helpful? Give feedback.
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 was trying to use the
useObservable
with the deps property. Inside theuseObservable
code, the useEffect works fine when the deps is changed. But as we filled with an observableId, thepreloadObservable
negates the changes on theuseObservable
deps because it is using a cached observable that matches the observableId filled.I need help with that because I want the
useObservable
to re-subscribe using the new values I passed to the observable.References:
reactfire/reactfire/useObservable/index.ts
Line 45 in 68cfc79
reactfire/reactfire/useObservable/index.ts
Line 19 in 68cfc79
Beta Was this translation helpful? Give feedback.
All reactions