Add cljs-ajax plugin

This commit is contained in:
kloimhardt 2021-06-11 14:11:59 +02:00 committed by GitHub
parent 0c0d5afacd
commit f5b014864f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 5 deletions

View file

@ -3,7 +3,8 @@
(:require [goog.object :as gobject]
[goog.string]
[sci.core :as sci]
[scittle.impl.error :as error]))
[scittle.impl.error :as error]
[cljs.reader :refer [read-string]]))
(clojure.core/defmacro time
"Evaluates expr and prints the time it took. Returns the value of expr."
@ -17,13 +18,16 @@
(def stns (sci/create-ns 'sci.script-tag nil))
(def cljns (sci/create-ns 'clojure.core nil))
(def rns (sci/create-ns 'cljs.reader nil))
(def namespaces
{'clojure.core
{'println println
'prn prn
'system-time system-time
'time (sci/copy-var time cljns)}
'time (sci/copy-var time cljns)
'random-uuid random-uuid
'read-string (sci/copy-var read-string rns)}
'goog.object {'set gobject/set
'get gobject/get}})