Skip to content

Instantly share code, notes, and snippets.

@darwin
Last active December 9, 2015 21:29
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 darwin/e4879f8442f9a60d4f89 to your computer and use it in GitHub Desktop.
Save darwin/e4879f8442f9a60d4f89 to your computer and use it in GitHub Desktop.
(def repl-channel (chan))
(defn make-custom-read []
(let [pending-read? (volatile! false)]
(fn [& args]
(println ":read called" args)
(if-not @pending-read?
(go
(println "calling cljs.repl/repl-read")
(let [result (apply cljs.repl/repl-read args)]
(println "put!" result)
(>!! repl-channel result)
(vreset! pending-read? false))))
(<!! repl-channel))))
(defmethod start-cljs-repl :default
[_ figwheel-env opts]
(cljs.repl/repl* figwheel-env (assoc opts :read (make-custom-read))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment