Fork me on GitHub
#re-frame
<
2021-08-23
>
zendevil.eth10:08:44

I have the following map returned by reg-event-fx:

2   {:db (assoc db :raise-loading false)
  3    :dispatch [:save-contract-address
  4               (.. contract-instance -options -address)]}
but when I remove dispatch the db change occurs, but when itโ€™s present, the db change does not occur. How to fix this

p-himik10:08:35

I'm 99% certain that your observation is incorrect. Or you have some incredibly non-trivial setup with interceptors.

pavlosmelissinos16:08:49

Ok so https://github.com/day8/re-frame/blob/master/docs/FAQs/Inspecting-app-db.md mentions that: > inspecting via a REPL might be clumsy Is part of this "clumsiness" having incomplete access to the database? In my experience so far, some keys are missing from the database when I'm trying to access it from the REPL but they're there in the GUI (the browser). Can someone confirm that this can happen from time to time? If so, how can this be expected behaviour?

p-himik16:08:28

So (keys @re-frame.db/app-db) outputs only some of the keys, not all of them?

pavlosmelissinos16:08:14

I don't think I've ever had that problem with the top level of the database but yes, it happens regularly with nested maps, like

(-> @re-frame.db/app-db
      :x
      :y
      keys)

p-himik16:08:50

No idea. Can't even think of anything less bizarre than "you have shadowed the keys function by accident".

pavlosmelissinos16:08:31

I see, thanks! I avoid :use and :refer like the plague and there's no keys function in the namespace project I'm trying to access the db from but that was a nice guess ๐Ÿ™‚ I'm sure it's my fault somehow but I don't have the time right now to investigate more. I'll use the browser for inspections, it's no big deal ๐Ÿ˜‰