This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-16
Channels
- # adventofcode (1)
- # announcements (16)
- # babashka (7)
- # beginners (77)
- # calva (31)
- # cider (18)
- # clj-commons (16)
- # cljfx (5)
- # clojars (5)
- # clojure (33)
- # clojure-europe (15)
- # clojure-nl (1)
- # clojure-norway (15)
- # clojure-uk (4)
- # clojurescript (1)
- # conjure (1)
- # core-logic (7)
- # cursive (16)
- # data-science (4)
- # datalevin (6)
- # emacs (20)
- # events (5)
- # fulcro (15)
- # holy-lambda (1)
- # introduce-yourself (1)
- # jobs (2)
- # lsp (30)
- # luminus (3)
- # malli (3)
- # membrane-term (19)
- # missionary (62)
- # off-topic (39)
- # pathom (24)
- # polylith (5)
- # portal (9)
- # practicalli (3)
- # re-frame (16)
- # reagent (5)
- # remote-jobs (1)
- # reveal (21)
- # rewrite-clj (8)
- # shadow-cljs (13)
- # spacemacs (23)
- # sql (12)
- # timbre (2)
- # tools-deps (1)
- # xtdb (4)
in fact, it is often claimed that missionary can be used for something like excel, but how?
I can link multiple ap
using reactor, but reactor itself can't be reused as if in another reactor
(def A1 (atom 1))
(def A2 (atom 1))
(def A3 (m/reactor
(let [a1 (m/signal! (m/watch A1))
a2 (m/signal! (m/watch A2))]
(m/stream! (m/ap (+ (m/<! a1) (m/<! a2)))))))
you probably know what you're talking about, but I don't really understand what I'm talking about 🙃
We should both read https://sarabander.github.io/sicp/html/4_002e3.xhtml#g_t4_002e3_002e1
(m/ap (+ (m/?< a1) (m/?< a2)))
is not the right tool here, even though it seems to work it's suboptimal for this use case
in the example with excel I don't know if the cell should be represented, by ap
or by some atom connected to reactor
m/reactor
is a kind of transaction engine that ensures change propagations are consistent and glitch-free
and if it functions is ap
with latest
, then later I should connect the ui using reactor?
I understand excel worksheet in such a way that a cell has two roles, it is a store of values / function results, and it displays information to the user
assuming I'm using react, for example, I need to get the value present in the cell and call (.setState value)
keep in mind signal!
is lazy, if there's nothing but signals no effect will ever happen, that's why you need at least one stream!
at the end
maybe I will simplify it, because communicating in a foreign language about such detailed issues is apparently not very effective with me ; )
I'm just confused about whether I need to use reactor to calculate the result of a function using value taken from several ap
, because the result of reactor is a function and not another ap
, which I can't reuse as if in another ap.
At the same time I would like to separate the whole calculation from the ui
and only then, if necessary, use the values currently in the ap
and display them in the ui
@U053XQP4S don't worry about me not understanding. Thanks for your willingness to help. I'll poke around and at most come back when I have more precise questions.
I've added a wiki page on continuous flows https://github.com/leonoel/missionary/wiki/Continuous-flows
@U0BBFDED7 feel free to ask more questions, your feedback is highly valuable
@U0BBFDED7 it is glitching because the signals are not managed by the same reactor, you should have a single reactor for the whole app
(def db_ (atom {:a 1 :b 1}))
(defn expr [k >x]
(m/latest (fn [x] [:div (str k x)]) >x))
(defn app [>a >b >v]
(m/latest
(fn [a b v]
[:div a b v
[:div {:on-click #(swap! db_ update :a inc)}
"inc A"]
[:div {:on-click #(swap! db_ update :b inc)}
"inc B"]])
(expr "A = " >a)
(expr "B = " >b)
(expr "A + B = " >v)))
(def main
(m/reactor
(let [>store (m/signal! (m/watch db_))
>a (m/signal! (m/latest :a >store))
>b (m/signal! (m/latest :b >store))
>v (m/signal! (m/latest + >a >b))]
(m/stream! (m/latest render-hiccup! (app >a >b >v))))))
I feel like I'm breaking through a wall with my head, but I'm doing well because I can see a light on the other side
again, thanks for your patience @U053XQP4S
I've added a wiki page on continuous flows https://github.com/leonoel/missionary/wiki/Continuous-flows