Liking cljdoc? Tell your friends :D

reacl-c-basics.programs.core

Programs are an abstraction over items, that have a dedicated result, and form an async monad.

You will usually start with an item that allows some user interactions when the program is 'running', like

(c/defn-item my-form [running?]
  (dom/button {:disabled (not running?)
               :onClick (fn [v _] (c/return :action "done"))}))

Then define a program that runs that

(defn-program my-program []
  [res (await-action my-form)]
  (show (dom/div res)))

And then add running this program into your application

(dom/div "My program:" (runner (my-program)))
Programs are an abstraction over items, that have a dedicated result, and form an async monad.

You will usually start with an item that allows some user interactions when the program is 'running', like

```
(c/defn-item my-form [running?]
  (dom/button {:disabled (not running?)
               :onClick (fn [v _] (c/return :action "done"))}))
```

Then define a program that runs that

```
(defn-program my-program []
  [res (await-action my-form)]
  (show (dom/div res)))
```

And then add running this program into your application

```
(dom/div "My program:" (runner (my-program)))
```

raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close