Skip to content

Instantly share code, notes, and snippets.

@dupuchba
Created March 16, 2017 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dupuchba/0a3154d9bfaa1b8a1a7e14c3cae9cbf2 to your computer and use it in GitHub Desktop.
Save dupuchba/0a3154d9bfaa1b8a1a7e14c3cae9cbf2 to your computer and use it in GitHub Desktop.
(defui ElementList
static om/Ident
(ident [this {:keys [id]}]
[:list/by-id id])
static om/IQuery
(query [this]
[:id {:elements (om/get-query Element)}])
Object
(render [this]
(let [{:keys [id elements]} (om/props this)]
(dom/div nil
(dom/h4 nil (str "List with id : " id))
(dom/ul #js {:onDragEnter (fn [e]
(.preventDefault e))
:onDragOver (fn [e]
(set! (.. e -dataTransfer -dropEffect) "move")
(.preventDefault e))
:onDrop (fn [e]
(.preventDefault e)
;; Change our app state
)}
(map element elements))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment