{"action":"created","issue":{"url":"https://api.github.com/repos/bhauman/devcards/issues/48","labels_url":"https://api.github.com/repos/bhauman/devcards/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/bhauman/devcards/issues/48/comments","events_url":"https://api.github.com/repos/bhauman/devcards/issues/48/events","html_url":"https://github.com/bhauman/devcards/issues/48","id":110750646,"number":48,"title":"dom-node macro does not update on atom change","user":{"login":"fdserr","id":3100658,"avatar_url":"https://avatars.githubusercontent.com/u/3100658?v=3","gravatar_id":"","url":"https://api.github.com/users/fdserr","html_url":"https://github.com/fdserr","followers_url":"https://api.github.com/users/fdserr/followers","following_url":"https://api.github.com/users/fdserr/following{/other_user}","gists_url":"https://api.github.com/users/fdserr/gists{/gist_id}","starred_url":"https://api.github.com/users/fdserr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fdserr/subscriptions","organizations_url":"https://api.github.com/users/fdserr/orgs","repos_url":"https://api.github.com/users/fdserr/repos","events_url":"https://api.github.com/users/fdserr/events{/privacy}","received_events_url":"https://api.github.com/users/fdserr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-09T23:12:51Z","updated_at":"2015-10-23T11:28:18Z","closed_at":null,"body":"The following card shows the issue (include `dom-node` in the devcards `:require-macros` and paste-in):\r\n```clojure\r\n(defcard dom-node-not-updating\r\n  \"Seems dom-node doesn't update?\"\r\n  (dom-node\r\n    (fn [state node]\r\n      (set! (.-innerHTML node) (str \"Click me count: \" (:count @state)))\r\n      (set! (.-onclick node) #(swap! state update-in [:count] inc))))\r\n  {:count 0}\r\n  {:inspect-data true\r\n   :watch-atom true})\r\n```\r\nI have tracked the problem down to `defonce-react-class DomComponent` here: https://github.com/bhauman/devcards/blob/d3a3000593e5b07827ebc98ffe152f1a6520b486/src/devcards/core.cljs#L314\r\n\r\nAFAIK it does not make use of the `:data_atom` passed to it by `defn- dom-node*` here: https://github.com/bhauman/devcards/blob/d3a3000593e5b07827ebc98ffe152f1a6520b486/src/devcards/core.cljs#L498\r\n\r\nI'm not react-able enough to fix this, sorry =[ \r\n(and therefore in great need of `dom-node` !)\r\n"},"comment":{"url":"https://api.github.com/repos/bhauman/devcards/issues/comments/150548123","html_url":"https://github.com/bhauman/devcards/issues/48#issuecomment-150548123","issue_url":"https://api.github.com/repos/bhauman/devcards/issues/48","id":150548123,"user":{"login":"exupero","id":287159,"avatar_url":"https://avatars.githubusercontent.com/u/287159?v=3","gravatar_id":"","url":"https://api.github.com/users/exupero","html_url":"https://github.com/exupero","followers_url":"https://api.github.com/users/exupero/followers","following_url":"https://api.github.com/users/exupero/following{/other_user}","gists_url":"https://api.github.com/users/exupero/gists{/gist_id}","starred_url":"https://api.github.com/users/exupero/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/exupero/subscriptions","organizations_url":"https://api.github.com/users/exupero/orgs","repos_url":"https://api.github.com/users/exupero/repos","events_url":"https://api.github.com/users/exupero/events{/privacy}","received_events_url":"https://api.github.com/users/exupero/received_events","type":"User","site_admin":false},"created_at":"2015-10-23T11:28:18Z","updated_at":"2015-10-23T11:28:18Z","body":"I ran into this too and came up with a similar solution, but I also notice that the history controls don't appear when the state changes. They only show up after I save the file and Figwheel reloads."}}