Fork me on GitHub
#re-frame
<
2018-10-12
>
aaron5114:10:57

We have a large object of data that never changes after init. It's needed by events and views. Should it be in the :db? Or is the db only for data that could possibly change while the app is running? Currently we are passing the object around everywhere (a bit tedious)

danielstockton14:10:38

Dynamically loaded or hard coded?

danielstockton14:10:23

If hard-coded, just require it in every namespace where you need it. If dynamically loaded from some endpoint, then you probably want to put it in the db.

aaron5114:10:51

Dynamically loaded, only loaded once, very early on. (It's from a data attribute on a DOM node)

aaron5114:10:02

OK, we'll put it in the DB. I think we were just confused that we were subscribing to something that is not expected to change

danielstockton14:10:59

If its from a dom node which is loaded before the script, I would again just read it into a var

👍 4
mikethompson21:10:15

@aaron51 my advice us to put as much as you possibly can into app-db. I can't see a downside.

👍 4