anyone using koin? how do you handle cleaning up? e.g. closing open realm instances on closing app?
d
dawidhyzy
06/13/2019, 12:15 PM
This is why I don’t use Realm.
But how is #koin related to realm lifecycle?
e
Eric Martori
06/13/2019, 1:04 PM
I usually don't work with components that require manual cleanup. But I suppose that you could Scope your realm instances and close the scope and do the cleanup at the end of your application lifecycle
👍 1
j
Jan
06/13/2019, 1:06 PM
was just wondering how to handle removing listeners with koin in general
scope seems to be solving that
u
ursus
06/14/2019, 5:48 PM
btw there is no thing as app closing
j
Jan
06/17/2019, 9:21 AM
well activity destroy then ^^
k
kzotin
06/18/2019, 10:28 AM
Cleaning up realm is not koin's business imho.
I would suggest bind clearing to ViewModel scope
We currently use both koin & realm - and don't use realm listeners (except few cursors for long lists, which are cleared with ViewModel).
Instead we open & close realm for each request to DB - works pretty stable and quickly