clj-ajax
This commit is contained in:
parent
500f104c1a
commit
5efba438ee
4 changed files with 21 additions and 2 deletions
4
deps.edn
4
deps.edn
|
|
@ -7,7 +7,9 @@
|
||||||
reagent/reagent {:mvn/version "1.0.0"}
|
reagent/reagent {:mvn/version "1.0.0"}
|
||||||
cljsjs/react {:mvn/version "17.0.2-0"}
|
cljsjs/react {:mvn/version "17.0.2-0"}
|
||||||
cljsjs/react-dom {:mvn/version "17.0.2-0"}
|
cljsjs/react-dom {:mvn/version "17.0.2-0"}
|
||||||
cljsjs/react-dom-server {:mvn/version "17.0.2-0"}}
|
cljsjs/react-dom-server {:mvn/version "17.0.2-0"}
|
||||||
|
cljs-ajax/cljs-ajax {:mvn/version "0.8.3"}
|
||||||
|
}
|
||||||
|
|
||||||
:aliases
|
:aliases
|
||||||
{:dev
|
{:dev
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,8 @@
|
||||||
{:scittle {:entries [scittle.core]}
|
{:scittle {:entries [scittle.core]}
|
||||||
:scittle.reagent {:entries [scittle.reagent]
|
:scittle.reagent {:entries [scittle.reagent]
|
||||||
:depends-on #{:scittle}}
|
:depends-on #{:scittle}}
|
||||||
|
:scittle.ajax {:entries [scittle.ajax]
|
||||||
|
:depends-on #{:scittle}}
|
||||||
:scittle.makro-plugin {:entries [scittle.makro-plugin]
|
:scittle.makro-plugin {:entries [scittle.makro-plugin]
|
||||||
:depends-on #{:scittle}}}
|
:depends-on #{:scittle}}}
|
||||||
:build-hooks [(shadow.cljs.build-report/hook)]
|
:build-hooks [(shadow.cljs.build-report/hook)]
|
||||||
|
|
|
||||||
14
src/scittle/ajax.cljs
Normal file
14
src/scittle/ajax.cljs
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
(ns scittle.ajax
|
||||||
|
(:require [ajax.core :as ajx]
|
||||||
|
[sci.core :as sci]
|
||||||
|
[scittle.core :as scittle]))
|
||||||
|
|
||||||
|
(def rns (sci/create-ns 'ajax.core nil))
|
||||||
|
|
||||||
|
(def ajax-namespace
|
||||||
|
{'GET (sci/copy-var ajx/GET rns)
|
||||||
|
'POST (sci/copy-var ajx/POST rns)})
|
||||||
|
|
||||||
|
(scittle/register-plugin!
|
||||||
|
::ajax
|
||||||
|
{:namespaces {'ajax.core ajax-namespace}})
|
||||||
|
|
@ -7,7 +7,8 @@
|
||||||
(def rns (sci/create-ns 'reagent.core nil))
|
(def rns (sci/create-ns 'reagent.core nil))
|
||||||
|
|
||||||
(def reagent-namespace
|
(def reagent-namespace
|
||||||
{'atom (sci/copy-var r/atom rns)})
|
{'atom (sci/copy-var r/atom rns)
|
||||||
|
'cursor (sci/copy-var r/cursor rns)})
|
||||||
|
|
||||||
(def rdns (sci/create-ns 'reagent.dom nil))
|
(def rdns (sci/create-ns 'reagent.dom nil))
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue