                            (assoc new-state :updated_at (js/moment))))
       nil))
 
-(defn push-to-server []
-  (if-not @push-pending?
-    (js/setTimeout push-to-server 200)
-    (do (reset! push-pending? false)
-        (swap! state/socket* assoc :msg_sent_at (js/moment))
-        (chsk-send! [:client/state
-                     {:full (select-keys @client-state
-                                         client-state-push-to-server-keys)}]
-                    1000
-                    (fn [reply]
-                      ;(js/console.log (with-out-str (pprint ["push-to-server/reply" reply])))
-                      (when-not (sente/cb-success? reply)
-                        (reset! push-pending? true))
-                      (js/setTimeout push-to-server 200))))))
-
 
 ;;; routing state ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 

     [:section.active
      [:h3 "@state/socket-active?*"]
      [pre-component-pprint @state/socket-active?*]]
     [:section.push-pending
      [:h3 "@push-pending?"]
      [pre-component-pprint @push-pending?]]
     [:section.state-socket
      [:h3 "@state/socket*"]
      [pre-component-pprint @state/socket*]]]]

    [timothypratley.patchin :refer [diff patch]]
    ))


(declare chsk ch-chsk chsk-send! chsk-state)

