       (rx/subscribe $ (fn [[event model]] (-apply-effect event model))))
 
     ;; Initialize the stream machinary with initial state.
-    (emit! (swap-state (fn [s] (merge s state))))
+    (emit! (swap #(merge % state)))
     state-s))

    (-apply-update [_ state]
      (f state))))

(defn reset-state
  "A event that resets the internal state with
  the provided value."
  [state]

    UpdateEvent
    (-apply-update [_ _]
      state)))

(enable-console-print!)

(defn init
  "Initializes the stream event loop and
