I have just started to develop apps in ClojureScript and I'm using Figwheel with Reagent and LightTable. Everything seems to be super interactive, I really love the idea of REPL and code reload but I cannot figure out how is it possible to transfer ratom from browser to REPL. For instance if I am developing tictactoe and it would be awesome if I will be able to transfer current board state to REPL just to play with it there (check some functions behaviour etc). Is it possible?
For example, ratom is defined in the tictactoe.core
namespace as follows:
(defonce app-state (atom {:text "Welcom to the tictactoe!"
:board (new-board 3)}))
In browser console information about ratom is as shown:
#<Atom: {:text "Welcom to the tictactoe!", :board [[2 2 2] [1 1 2] [1 1 1]]}>
And when I'm trying to get information about the atom in the REPL in Terminal being in the tictactoe.core
namespace:
tictactoe.core=> app-state
#<Atom: {:text "Welcom to the tictactoe!", :board [[0 0 0] [0 0 0] [0 0 0]]}>
What I am doing wrong? In the same REPL I am getting println
the same as in the browser.
What should I do to get value of the ratom in the REPL?