From e5309fcd69b89036051e88a0843db776d3739904 Mon Sep 17 00:00:00 2001 From: Nicholas Kariniemi Date: Wed, 15 Oct 2014 21:26:28 +0300 Subject: [PATCH] Correct use of swap! --- src/cljx/grub/state.cljx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cljx/grub/state.cljx b/src/cljx/grub/state.cljx index e76112c..1d5719d 100644 --- a/src/cljx/grub/state.cljx +++ b/src/cljx/grub/state.cljx @@ -16,7 +16,7 @@ (defmethod handle-event :diff [{:keys [hash diff states shadow client? state] :as msg}] (let [history-shadow (sync/get-history-state states hash)] (if history-shadow - (let [new-state (swap! diff/patch-state state diff) + (let [new-state (swap! state diff/patch-state diff) new-states (sync/add-history-state states new-state) new-shadow (diff/patch-state history-shadow diff) new-diff (diff/diff-states new-shadow new-state)