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

@ -0,0 +1,14 @@
(ns scittle.cljs-ajax
(:require [ajax.core :as ajx]
[sci.core :as sci]
[scittle.core :as scittle]))
(def ans (sci/create-ns 'ajax.core nil))
(def ajax-namespace
{'GET (sci/copy-var ajx/GET ans)
'POST (sci/copy-var ajx/POST ans)})
(scittle/register-plugin!
::ajax
{:namespaces {'ajax.core ajax-namespace}})