Is it a bad idea to store a whole Datascript db value inside a reagent.core/atom
?
@teodorlu It is wild š But, datascript is just... an in memory database. So it's wild by design.
FWIW, this is more or less what Posh does.
Ah, OK. I almost asked about what Posh actually does. After not too much code, I had something that worked decently, so I wondered if there was much more to it. Is it worth the extra dependency? I guess they may have thought a bit more about API design than what I collected.
Iām in the same boat. I decided that I would work directly with the datascript until there was compelling reason to add a new dependency
Yeah; So the thing Posh does is give you reactive queries that only update if it looks new transactions have a chance of effecting the result. So it saves you some compute. However, it doesn't always do this perfectly; There are some edge cases like recursive query rules (and maybe using query functions?), and I don't remember now whether it catches these and updates them automatically. As a last resort, you can specify a custom pattern for deciding when to rerun a query if something is amiss. I'd say it's pretty convenient and worth taking a look at.
If don't expect to ever have too much data or too many queries though, it may not be necessary.
I do. Works fine for me.