Reset state on full sync
This commit is contained in:
parent
96dd93309d
commit
0bf8344c62
2 changed files with 5 additions and 4 deletions
|
@ -4,7 +4,7 @@
|
|||
|
||||
(defn full-sync [state]
|
||||
{:type :full-sync
|
||||
:state state})
|
||||
:full-state state})
|
||||
|
||||
(defn diff-msg [diff hash]
|
||||
{:type :diff
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue