Created
August 10, 2021 07:24
-
-
Save serioga/7194c0d9487027a7d515870b07432216 to your computer and use it in GitHub Desktop.
CLJS REPL in browser.
This file contains hidden or 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 dev.env.cljs-repl.browser | |
"CLJS REPL in browser. See https://clojurescript.org/reference/repl. | |
Run local clojure.main REPL with `-m dev.env.cljs-repl.browser` parameters to work from Cursive." | |
(:require [cljs.repl :as repl] | |
[cljs.repl.browser :as browser])) | |
;••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• | |
(def ^:private output-dir "out/repl/browser") | |
(defn- -main | |
[] | |
(-> (browser/repl-env :output-dir output-dir) | |
(repl/repl :output-dir output-dir | |
:quit-prompt (fn [] | |
(repl/repl-title) | |
(repl/repl-quit-prompt))))) | |
(comment (-main)) | |
;••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••• | |
#?(:cljs (comment (js/alert "Hello CLJS!") | |
:cljs/quit)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment