Hello, when I load my db namespace into the Clojure repl and print the DB after doing operations in re-frame I just get the initial db state. Is there a way to inspect the DB using the repl? I am a Clojure newbie sorry if that doesn't make any sense
a regular CLJS REPL will show you the current state. could be that you are not using the correct REPL or a CLJ REPL?
Not what you asked, but perhaps use re-frame-10x? Create an app using the re-frame-template will show how you get it included in your project.
Iβm using the CLJS REPL in shadow. I cloned this template: https://github.com/PEZ/rn-rf-shadow/tree/master. Is it possible that itβs because app-db is not wrapped in a ratom?
are you referring to this https://github.com/PEZ/rn-rf-shadow/blob/a761708dbb34481f063c7dff9b76a32f1828310a/src/main/example/db.cljs#L4
because that is not your actual app-db, just the initial state
the actual state you can get via @re-frame.db/app-db in the REPL
Got it, thank you. I am learning re-frame and some of the magic stumps me sometimes π
in shadow-cljs you can also run (tap> @re-frame.db/app-db) and look at the value in the inspect ui http://localhost:9630/inspect
That's amazing, thanks! I'll take a look. @mikethompson thanks for suggesting the re-frame-10x tool as well
Stuff like this is why I invested in learning ClojureScript
@nnnsadeh Just in case - check out cljs-devtools as well, it allows you to view CLJS data structures in a very nice way when printed with js/console.log.
doesn't help for react-native builds though?
No clue, but I didn't see it being mentioned.