Open kdabir opened 1 year ago
@kdabir yep, you are right, we should have the way to access dbs
without DbsHolder
. The idea of
either DbsHolder accepts a db object, that I can create and pass to it
Looks preferable to me, but then also you will need somewhere to add the code to close db on page leave (if necessary). Currently, DbsHolder
has useEffect
which stops db on demount.
Not sure about deadlines for now though
I am trying to fire queries in react router loaders / actions. Since loader/actions functions are neither react hooks, nor they are components, I cannot call hooks like
useDbQuery
in these functions. I get this error if I do:I cannot access the db object as that is created/managed by the
DbsHolder
and is only available inside hooks. I only pass the config at the instantiationSo, to fix this: