(reg-effects & keyvals)
Register one or more effects.
(reg-effect
::echo
(fn [& args]
(prn args))
::echo2
(fn [& args]
(prn args)))
(act ::echo "Hello, World!")
Register one or more effects. ```clojure (reg-effect ::echo (fn [& args] (prn args)) ::echo2 (fn [& args] (prn args))) (act ::echo "Hello, World!") ```
(reg-streams & keyvals)
Register one or more data streams.
(defonce !db (atom {}))
(reg-stream
:db
(fn [rx path]
(rx (get-in @!db path)))
:other
(fn [rx]
(rx "thing")))
If a function is returned it will be called to cleanup the stream once it's spun down.
Each pair of [stream-key args]
represents a unique
stream instance, so the method will be called only once
for each set of args used with the stream; until the
stream has been spun down and must be restarted.
Register one or more data streams. ```clojure (defonce !db (atom {})) (reg-stream :db (fn [rx path] (rx (get-in @!db path))) :other (fn [rx] (rx "thing"))) ``` If a function is returned it will be called to cleanup the stream once it's spun down. Each pair of `[stream-key args]` represents a unique stream instance, so the method will be called only once for each set of args used with the stream; until the stream has been spun down and must be restarted.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close