update build
This commit is contained in:
parent
4a10959db6
commit
3908a73ed9
13 changed files with 3370 additions and 3090 deletions
28
index.html
28
index.html
|
|
@ -3,9 +3,10 @@
|
|||
<head>
|
||||
<link rel="stylesheet" href="css/style.css">
|
||||
<script src="js/scittle.js" type="application/javascript"></script>
|
||||
<script crossorigin src="https://unpkg.com/react@17/umd/react.production.min.js"></script>
|
||||
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.production.min.js"></script>
|
||||
<script crossorigin src="https://unpkg.com/react@18/umd/react.production.min.js"></script>
|
||||
<script crossorigin src="https://unpkg.com/react-dom@18/umd/react-dom.production.min.js"></script>
|
||||
<script src="js/scittle.reagent.js" type="application/javascript"></script>
|
||||
<!-- <script src="js/scittle.re-frame.js" type="application/javascript"></script> -->
|
||||
<script src="js/scittle.cljs-ajax.js" type="application/javascript"></script>
|
||||
<script src="js/scittle.pprint.js" type="application/javascript"></script>
|
||||
|
||||
|
|
@ -20,14 +21,26 @@
|
|||
|
||||
(def state (r/atom {:clicks 0}))
|
||||
|
||||
#_(require '[re-frame.core :as rf]
|
||||
'[reagent.dom :as rdom])
|
||||
#_(rf/reg-event-fx ::click (fn [{:keys [db]} [_]] {:db (update db :clicks (fnil inc 0))}))
|
||||
#_(rf/reg-sub ::clicks (fn [db _] (:clicks db)))
|
||||
|
||||
(defn my-component []
|
||||
[:div
|
||||
[:p "Clicks: " (:clicks @state)]
|
||||
[:p [:button {:on-click #(swap! state update :clicks inc)}
|
||||
[:p [:button {:on-click #(do (swap! state update :clicks inc)
|
||||
#_(rf/dispatch [::click]))}
|
||||
"Click me!"]]])
|
||||
|
||||
#_(defn re-frame-component []
|
||||
(let [clicks (rf/subscribe [::clicks])]
|
||||
[:div "Clicks:" @clicks]))
|
||||
|
||||
(rdom/render [my-component] (.getElementById js/document "app"))
|
||||
|
||||
#_(rdom/render [re-frame-component] (.getElementById js/document "re-frame"))
|
||||
|
||||
(require '[ajax.core :refer [GET]])
|
||||
|
||||
(defn handler [response]
|
||||
|
|
@ -74,7 +87,7 @@
|
|||
|
||||
To embed scittle in your website, it is recommended to use the links
|
||||
published to
|
||||
the <a href="https://github.com/babashka/scittle/releases/tag/v0.3.10">releases
|
||||
the <a href="https://github.com/babashka/scittle/releases/tag/v0.4.11">releases
|
||||
page</a>.
|
||||
|
||||
Include <tt>scittle.js</tt> and write a <tt>script</tt> tag
|
||||
|
|
@ -108,6 +121,13 @@
|
|||
|
||||
<div id="app"></div>
|
||||
|
||||
|
||||
<a name="re-frame"></a>
|
||||
<h2><a href="#re-frame">Re-frame plugin</a></h2>
|
||||
|
||||
To enable <a href="https://github.com/day8/re-frame">reagent</a>,
|
||||
in addition to the files needed for reagent, you need to include <tt>scittle.re-frame.js</tt>.
|
||||
|
||||
<a name="cljs-ajax"></a>
|
||||
<h2><a href="#cljs-ajax">Cljs-ajax plugin</a></h2>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue