Skip to content

Instantly share code, notes, and snippets.

@dupuchba
Created March 16, 2017 19:10
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/04708b20b9b433205990f15b242344ef to your computer and use it in GitHub Desktop.
Save dupuchba/04708b20b9b433205990f15b242344ef to your computer and use it in GitHub Desktop.
(defmulti mutate om/dispatch)
(defmethod mutate 'element/drag
[{:keys [state]} _ params]
{:value {:keys [:elements/dragged]}
:action (fn []
(if-not (empty? params)
(swap! state assoc :elements/dragged params)
(swap! state assoc :elements/dragged nil)))})
(def parser (om/parser {:read read :mutate mutate}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment