Hi Anton,

 In the Coils framework it does actually share structures (atoms) from the 
client to the server, which can then be replayed back to the client again. An 
example is at:

http://connecttous.co/

:where you can play around with the sample application, and then you can go to:

http://connecttous.co/connecttous/connecttous.html?playback=true

: to play back the sessions. The way this is done is by just sending the 
updates of the Om Application State to the server (assuming you are using David 
Nolen's Om for the client side) using Om's tx-listen. Here is where the code is:

https://github.com/zubairq/coils/search?q=tx-listen&ref=cmdform

: tx-listen takes two arguments, the first of which contains the changes:

 (fn [tx-data root-cursor]

: so you can do  (:path tx-data) to get just the changes to the GUI, which is 
what Coils does, and then it sends those changes to the server. To see the 
changes being sent live to the server, if you go to connecttous.co and do stuff 
in the GUI, then open the network console, you can see calls to the server 
which send the GUI state from client to server, by looking out for the calls 
which are something like this:

http://connecttous.co/connecttous/action?systemaction=!add-history&params=....

:This sends the GUI changes back to the server, which then get stored in the 
backend.


Regarding Andrew Chamber's point about tree diff, Andrew is spot on! In fact 
when you do local debugging in Coils:

http://connecttous.co/connecttous/connecttous.html?livedebug=true

: on the right you can see changes to two trees that Coils uses, called UI and 
DATA. To show these changes it uses the Clojure diff call:

https://github.com/zubairq/coils/search?q=deleted+++++%28first+&type=Code

:which shows added and deleted entries from the trees. I hope this helps and 
that you can apply something similar to your own project.

Thanks
Zubair


-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to