This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-04-09
Channels
- # admin-announcements (1)
- # boot (225)
- # braid-chat (1)
- # cider (25)
- # cljs-dev (35)
- # cljsrn (1)
- # clojars (6)
- # clojure (81)
- # clojure-berlin (1)
- # clojure-dev (21)
- # clojure-france (2)
- # clojure-japan (6)
- # clojure-poland (1)
- # clojure-russia (10)
- # clojure-uk (3)
- # clojurescript (121)
- # code-reviews (1)
- # core-async (4)
- # core-logic (2)
- # cursive (15)
- # datomic (8)
- # hoplon (4)
- # jaunt (112)
- # jobs-discuss (35)
- # om (41)
- # parinfer (8)
- # re-frame (3)
- # reagent (4)
- # ring (2)
- # untangled (38)
I've implemented a POC with MutationObserver-based attr change listeners: https://github.com/dm3/hoplon/commit/399c13953fb0446e9c3ba3c5ff45232e52d0a092
used like this:
(page "index.html"
(:require [hoplon.attrs :as a]))
(defelem width-section [_ kids]
(let [[w h] [(cell 100) (cell 100)]]
(div :css (cell= {:border "1px solid black", :width w, :height h})
:change/style #(println "Old:" (a/old-value %) ", new:" (a/new-value %))
(button :click #(swap! w + 10) "inc width")
(button :click #(swap! w - 10) "dec width"))))
(html
(body
(div :id "container"
:css {:width "500px", :height "500px"}
(width-section))))