Skip to content

Instantly share code, notes, and snippets.

@mhuebert
Created August 4, 2015 16:02
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 mhuebert/117f22704e874d6259ac to your computer and use it in GitHub Desktop.
Save mhuebert/117f22704e874d6259ac to your computer and use it in GitHub Desktop.
a simple http-get fn
(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