Missionary primitives fit into three categories:
- continuous flow, m/?< (switch)
- m/watch, m/latest, m/cp
- m/observe
- m/reductions, m/relieve
Easy:
query-pokemon-list
for the querye/offload
to move it to a thread pool.
e/offload
throws Pending
until the query finishes, and then the exception "goes away"Electric is a "multi tier" Clojure/Script dialect for full-stack web application development. It uses macros to let you interweave client and server code in a single .CLJC file, so you can define a full-stack frontend/backend webapp all in one place. Electric is designed for rich dynamic applications with reactive user interfaces and complex frontend/backend data sync requirements.
Electric Clojure implements a form of arrowized continuous time dataflow programming with extensions for network-transparent function composition.
(ns contrib.ui.remark | |
(:require | |
;["@hyperfiddle/remark-generic-extensions/lib/browser.min" :as remark-generic-extensions] ; works in node | |
[clojure.set] | |
[clojure.string] | |
; Refrain from contrib imports so this is more suitable for userland | |
[goog.object] | |
[prop-types] ; used as js/propTypes.object | |
[reagent.core] | |
;[remark] ; works in node |
This video demonstrates traversing a filesystem tree from the frontend. The filesystem tree exists only on the server, and the HTML view exists only on the client. Nonetheless, we are able to unify the query/view logic into a single recursion in the simple, direct style of PHP, despite network. The Electric compiler automatically coordinates fine-grained reactive network sync.
Code note: in this video from last year, ~@
is the legacy syntax for client/server transfer, it has since been superseded by e/client
and e/server
markers.
Code is not optimized yet – we are still learning the idioms.