Created
April 14, 2015 13:31
-
-
Save jaen/13260c5c763878d99d01 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
(defn synchronise-folders [{:keys [user] :as opts}] | |
(let [result-chan (chan) | |
owner-id (:id user)] | |
(go (log/log "request about to be sent") | |
(logic/dispatch-event [:api :folders :get] {:params {:owner owner-id} :result-chan result-chan}) | |
(let [result (<! result-chan)] | |
(log/log "result came back:" result) | |
(match result | |
[:success {:list folders}] (update-db-entities (map prepare-folder folders)) | |
[:error new-errors] nil))))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment