Fork me on GitHub

@flyboarder i was trying to make bidi work, but it's a bit too much (~600lines), especially for SPA routing. that's why i went with what hoplon ui. 1. it has one route cell 2. which has a structure like [[:path :segments ...] {:param1 "val1"}] 3. representing #/path/segments/...?param1="val1" 4. and its bidirectionally bound to js/window.location.hash


we agreed to have a convention in our app, so the 1st path element always represents a view or screen as micha calls it and the 2nd path elem represents alternate versions of that screen, which are usually implemented as tabs visually. that's why i defined the following path-cells:

(def current-path (path-cell route [0]))
(def current-qmap (path-cell route [1]))
(def current-view (path-cell route [0 0]))
(def current-tab (path-cell route [0 1]))
so i can independently change these various bits, besides concisely writing code which depend on them


sorry, completely wrong conf


@thedavidmeister: dang, my reply seems to have disappeared. I like plottable very much, but I needed to zoom-pan an ordinal axis (because I had a lot of categories) and plottable didn't support it, so I had to go back to vanilla d3.


unfortunately you can't easily tell which nodes in the graph correspond to which cells in the source code, but since i've made this, cljs has begun to support retaining Var metadata. so source code and def names could be available at runtime, and we could potentially then show in visualizations like this


I have this timer element and i'm trying to get the timer element todisplay "0:00" before the js/alert fires off, is there an easy way to do this that i'm missing? (countdown cell is seconds remaining)

(defelem countdown [{:keys [countdown-cell] :as attrs} kids]
  (let [interval (.setInterval js/window #(swap! countdown-cell dec) 1000)]
     (when (zero? countdown-cell)
       (js/alert "DONE")
       (.clearInterval js/window interval)))
    (div attrs
         (cell= (pprint/cl-format nil
                                  (int (/ countdown-cell 60))
                                  (mod countdown-cell 60))))))


currently the alert fires while the timer displays 0:01 and only after closing the alert does it show 0:00


what about closing it at -00:01?


let the countdown go to -1


then no race condition exists


there must be some amount of time you want to show 00:00 before the alert opens


so have the alert open at that amount of time past zero


cool, simple but should work, thanks!


@jjttjj love the cl-format action btw!