How can I process an infinite sequence in ClojureScript, doing DOM manipulations per element, and then waiting some time before continuing (for example, if I wanted to have a div on a page that was showing a number that incremented once per second)?
Using the dommy library for DOM interaction, here's a (non-working) code example:
(def container (sel1 :#container))
(defn integers [] (iterate inc 0))
(js/setInterval
(fn []
(dommy/set-text! container (nth (integers) i)) ; whence i?
)
1000)
Obviously indexing into this sequence is not a long-term solution.