This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-03-30
Channels
- # bangalore-clj (1)
- # beginners (23)
- # boot (1)
- # cider (23)
- # cljsjs (2)
- # cljsrn (4)
- # clojure (251)
- # clojure-dusseldorf (2)
- # clojure-gamedev (23)
- # clojure-italy (5)
- # clojure-russia (53)
- # clojure-sanfrancisco (5)
- # clojure-spec (7)
- # clojure-uk (66)
- # clojurescript (169)
- # community-development (21)
- # core-async (10)
- # cursive (15)
- # data-science (1)
- # datomic (7)
- # docker (1)
- # emacs (24)
- # events (1)
- # funcool (6)
- # hoplon (24)
- # liberator (1)
- # luminus (6)
- # lumo (62)
- # mount (7)
- # off-topic (1)
- # om (12)
- # om-next (5)
- # onyx (14)
- # overtone (2)
- # pedestal (58)
- # powderkeg (27)
- # protorepl (1)
- # re-frame (1)
- # ring-swagger (16)
- # rum (51)
- # spacemacs (25)
- # uncomplicate (7)
- # unrepl (22)
- # untangled (7)
- # yada (109)
@piotrek no, but i just realized, if you make a mutation observer for the parent element of a loop-tpl, oyu could receive events
at least, this is my yet-untested theory 😎 ™️
i think mutation observer API is deprecated/dead but still in many browsers
would be curious to see what you're doing that you want a removal event
hi fingertoe 👋
Hello! I am pretty excited to use Hoplon in a couple of projects I am working on. Playing with it, I like it, and it seems pretty easy to understand!
cool! give a shout if you hit any snags
friendly group here
@alandipert i think mutation observer api still works fine, there's an older event based mutation api that is deprecated
actually i put a placeholder issue up at https://github.com/hoplon/hoplon/issues/176 if you want to discuss further @piotrek @alandipert
@alandipert, @thedavidmeister I was thinking about cases when I would like to integrate some heavyweight external component (e.g. google maps) which would be wrapped in my own element. Another scenario would be to create a standalone element which would create or start some background process and it should be cleaned up / stopped when the element is removed from the DOM. Maybe it should be achieved in a different way and this is a XY problem 🙂
@piotrek for the latter, i've used a lens
p (let [c (j/cell 0)]
(h/do-watch c dirty!)
(j/cell= c
#(when-not @paused? (reset! c %))))
out of context snippet 🙂 ^^
if you're adding removing something with a when-tpl
you can just use the same predicate cell for paused?
i'm not 100% sure why you need to respond to google maps leaving the DOM
if you want to pause/throttle/debounce cells for performance it's actually pretty easy and is probably best decoupled from the state of the DOM anyway
I would like for example to remove the google maps component completely so it does not occupy memory
oh, wait - now I am looking at https://github.com/hoplon/hoplon/wiki/Dynamic-DOM-manipulation-aka-Template-Macros
I was under impression that previously for example loop-tpl wasn’t removing/destroying the dom nodes but only detaching them and retaining them in a cache
But it looks like they are still created once and reused (but just detached from dom)