React toolkits in ClojureScript based on React component in pure cljs using ES6 class inheritance
Demo http://repo.respo-mvc.org/reacher/
[respo/reacher "0.1.0"]
Example:
(def comp-space
(create-comp
{:name :comp-space}
(fn [[w h] state mutate!]
(if (some? w)
(div {:style (adorn {:display :inline-block, :width w})})
(div {:style {:height h}})))))
(def comp-creator
(create-comp
{:state "",
:name :creator,
:mount (fn [] (.. js/document (querySelector ".box") (focus)))}
(fn [[] state mutate!]
(div
{:style (adorn ui/row-middle)}
(input
{:className "box",
:style (adorn ui/input),
:placeholder "task content",
:value state,
:onChange (fn [event] (mutate! (get-value event)))})
(comp-space 8 nil)
(button
{:style (adorn ui/button),
:onClick (fn []
(when (not (string/blank? state)) (dispatch! :create state) (mutate! "")))}
"Add")))))
Public APIs:
reacher.core/create-comp
reacher.core/adorn
reacher.core/get-value
reacher.core/get-state
reacher.core/set-state!
reacher.core/dispatch!
reacher.core/register-dispatcher!
reacher.core/div
reacher.core/span ; and more
reacher.core/tag*
Supported options:
:state
:key-fn
:name
:mount
:unmount
:update
Based on calcit-workflow.
MIT
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close