Created
August 4, 2015 16:02
-
-
Save mhuebert/117f22704e874d6259ac to your computer and use it in GitHub Desktop.
a simple http-get fn
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
(ns cells.io | |
(:require | |
[cljs.core.async :refer [put! chan]] | |
[goog.net.XhrIo :as xhr])) | |
(defn GET [path] | |
(let [c (chan)] | |
(xhr/send path #(do | |
(put! c (-> % .-target .getResponseText)) "GET")) | |
c)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment