Last active
December 9, 2015 21:29
-
-
Save darwin/e4879f8442f9a60d4f89 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
(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