Created
March 16, 2017 19:10
-
-
Save dupuchba/04708b20b9b433205990f15b242344ef to your computer and use it in GitHub Desktop.
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
(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