re-frame-10x
re-frame-10x copied to clipboard
Possible to get raw EDN?
I recall that another re-frame inspector (re-frame-trace? Or maybe re-frisk?) allowed the user to get the raw EDN of e.g. DB state.
I find this faster than having to horizontally scroll, then expand, then scroll again, then expand, etc. This is particularly a problem when keywords have long namespaces.
Is it possible to get the raw EDN out of re-frame-10x?
@xiongtx just keep this little snippet somewhere close
cljs.core.deref(re_frame.db.app_db)
type it in Chrome Dev Tools Console and you get the whole app db state in raw edn form (don't forget to enable custom formatters)
☝️This gives me something w/ an expander in the console:

oh, well cljs.pprint.pprint(cljs.core.deref(re_frame.db.app_db)), which I admit is a bit silly. And I agree with you: default style used for custom formatter in cljs.devtools (and later adopted in re-trace) is mildly inconvenient.
@mike-thompson-day8 it would be nice to have an option to see things in app-db inspector (or at least copy them to clipboard) "as is"
@xiongtx are you asking for prn-str of app-db? What will you do with it once you have it as a string? If the map expansion lived directly below the keyword, would that be more useful for you?
Yeah, anything to help the horizontal scrolling would be good. And maybe an "expand all"?
@xiongtx so once you have the prn-str of app-db, what happens to it after then? It gets pasted into a REPL? Or just into a text buffer for further inspection?
@mike-thompson-day8 I would like to second @xiongtx that the ability to copy the EDN as a string to the clipboard or console would be a very useful thing. Further, since everything is just data, this should be available from all 10x tabs, each app-db inspector, subscription results, events vectors etc. Note: re-frame subscriptions are particularly interesting at times since in more complex cases, they are materialized views of app-db, so ephemeral by nature. I would like to switch to the subs tab and export the result of any sub.
Why ?
- trivial collection of arbitrary app-db data or subscriptions for fixtures in unit-tests and for docs.
- save developer time identifying and instrumenting the right event handler or subscription to place
pr-strand log to console. - ability to further inspect/debug/transform within an editor which understands EDN including IntelliJ/Cursive, Sublime etc.
Would be nice to add a clipboard button in various places, such as pods or pod-headers. It seems doable.
In the meantime, day8.re-frame-10x/traced-result might come in handy to print structures in the repl.
Closed via https://github.com/day8/re-frame-10x/pull/390