Reset state on full sync

This commit is contained in:
Nicholas Kariniemi 2014-10-15 21:22:53 +03:00
parent 96dd93309d
commit 0bf8344c62
2 changed files with 5 additions and 4 deletions

View file

@ -4,7 +4,7 @@
(defn full-sync [state]
{:type :full-sync
:state state})
:full-state state})
(defn diff-msg [diff hash]
{:type :diff

View file

@ -37,9 +37,10 @@
{:new-shadow state
:out-event (message/full-sync state)}))
(defmethod handle-event :full-sync [{:keys [state states]}]
{:new-states (sync/new-state state)
:new-shadow state})
(defmethod handle-event :full-sync [{:keys [full-state states state]}]
(reset! state full-state)
{:new-states (sync/new-state full-state)
:new-shadow full-state})
(defmethod handle-event :default [msg]
#+cljs (logs "Unhandled message:" msg)