Skip to content

Instantly share code, notes, and snippets.

@jaen
Created April 14, 2015 13:31
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 jaen/13260c5c763878d99d01 to your computer and use it in GitHub Desktop.
Save jaen/13260c5c763878d99d01 to your computer and use it in GitHub Desktop.
(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