Search code examples
clojurescriptom

How to inspect om objects?


I've been following the om tutorial. Im using Light Table to setup an External Browser connection. Additionally, in my clojurescript code I'm calling (enable-console-print!) to send my println statements to the browser console.

The problem is that when I print an om component.. something like:

(println (om/build my-component-function my-data))

The output I get is:

#<[object Object]>

I have the same issue if I just eval (om/build my-component-function my-data) in LightTable.

Being able to inspect this object will be helpful for debugging. How can I print something more meaningful?


Solution

  • 1 Try using (.log js/console object) which is ClojureScript equivalent of console.log(object);

    2 You may also install React Developer Tools extension for Google Chrome, which will allow you to browse React/Om components you have on page