Created
October 8, 2014 19:07
-
-
Save spinningtopsofdoom/99d308b65323c1fe2d81 to your computer and use it in GitHub Desktop.
getting index for an Om component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn piece-view [data owner] | |
(let [[_ row] (om/path data)] | |
(reify | |
om/IRender | |
(render [_] | |
(dom/div nil row))))) | |
(defn board-view [app owner] | |
(let [size 40] | |
(reify | |
om/IRender | |
(render [_] | |
(apply | |
dom/div | |
#js { | |
:style #js { :width size :height size } | |
:id "board" | |
} | |
(om/build-all piece-view [ 3 3 3 3 ] )))))) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment