Last active
August 29, 2015 14:19
-
-
Save sparkofreason/8bdbde5d60137f84c9b6 to your computer and use it in GitHub Desktop.
rx-expression with child cursor does not update correctly
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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