A framework for page-based application.
For a standard HTML5 history page-based application, create 3 files:
my_routes.cljc
(ns my-routes (:require [reacl-basics.pages.routes :as r]))
(r/defroute article "/article/:id")
my_pages.cljs
(ns my-pages (:require [reacl-basics.pages.core :as p]
[my-routes :as my]))
(defclass article-page this app-state [id]
render ...)
(defclass main this app-state []
render
(html5-history-router (reacl/opt ...) app-state
{my/article (p/page article-page)}))
my_client.clj
(ns my-client (:require [reacl-basics.pages.ring :as r]
[reacl-basics.pages.routes :as routes]
my-routes))
(-> app
(r/wrap-client-routes routes/routes (ring-http/ok "<html>...")))
A framework for page-based application. For a standard HTML5 history page-based application, create 3 files: my_routes.cljc ``` (ns my-routes (:require [reacl-basics.pages.routes :as r])) (r/defroute article "/article/:id") ``` my_pages.cljs ``` (ns my-pages (:require [reacl-basics.pages.core :as p] [my-routes :as my])) (defclass article-page this app-state [id] render ...) (defclass main this app-state [] render (html5-history-router (reacl/opt ...) app-state {my/article (p/page article-page)})) ``` my_client.clj ``` (ns my-client (:require [reacl-basics.pages.ring :as r] [reacl-basics.pages.routes :as routes] my-routes)) (-> app (r/wrap-client-routes routes/routes (ring-http/ok "<html>..."))) ```
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close