Factory reset #254
Unanswered
mikeymike9000
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using Factory along with Firebase/Firestore and wondering how to best reset repositories when a user logs out of Firebase so that no data or listeners remain in my data repository. I'd been running into situations where some data persisted and also crashes due to dangling references, though I could not find any strong references to self and wondered if it might be internal to Firestore.
I'd also been 'blindly' using .reset() (e.g. Container.shared.PayloadRepo.reset()) but I think that may have also been part of the issue.
I now have a kludgey 'Factory reset' that appears to remove all listeners and data, here are relevant code snippets:
I plan to replace this 'hack' (delays and repeated unsubscribes) when I can carve out some time to actually understand the inner workings.
Is there a best practice to 'simply' 'clear out' Factories?
Should I also be using .reset()?
Is this hack as horrible as it seems and does anyone have any advice that might expedite my journey?
thanks for any help!! Mike
Beta Was this translation helpful? Give feedback.
All reactions