Skip to content

Instantly share code, notes, and snippets.

@sparkofreason
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sparkofreason/8bdbde5d60137f84c9b6 to your computer and use it in GitHub Desktop.
Save sparkofreason/8bdbde5d60137f84c9b6 to your computer and use it in GitHub Desktop.
rx-expression with child cursor does not update correctly
(ns freactive-sandbox.rx-test
(:require-macros [freactive.macros :refer [rx debug-rx]])
(:require [freactive.core :refer [atom cursor]]
[freactive.dom :as dom]))
#_(enable-console-print!)
(def state (atom {:a 1 :b {:c 2 :d 3}}))
(def b (cursor state :b))
(def d (cursor state [:b :d]))
(defn view
[]
[:div
[:div (rx (str "d = " @d))]
[:div (rx (str "(b :d) = " (@b :d)))]])
(dom/mount! (.getElementById js/document "root") (view))
(reset! b {:c 4 :d 5})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment