How to Manage Long-Lived Resources Without Reconstructing in Effects
What is the best way to model a long living resource that shouldnt be re-constructed on each effect that requires it?
Im working with on the frontend IndexedDB and it is suggested to open a db (
indexedDB.open
indexedDB.open
) once and keep it open throughout the lifetime of your application.
However when i setup a tag+service for manging the database, i noticed that the database is re-opened anytime an effect which requires it's service is ran.