This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-08-31
Channels
- # aleph (37)
- # babashka (23)
- # beginners (46)
- # calva (1)
- # catalyst (12)
- # cider (3)
- # circleci (5)
- # clj-kondo (8)
- # clojure (188)
- # clojure-europe (28)
- # clojure-nl (1)
- # clojure-norway (84)
- # clojure-sweden (2)
- # clojure-uk (1)
- # clojurescript (6)
- # clr (1)
- # cursive (4)
- # datahike (4)
- # datascript (7)
- # datomic (31)
- # deps-new (16)
- # emacs (4)
- # fulcro (4)
- # gratitude (17)
- # hyperfiddle (24)
- # introduce-yourself (4)
- # jobs (5)
- # off-topic (84)
- # pathom (10)
- # polylith (21)
- # portal (6)
- # re-frame (6)
- # reitit (4)
- # releases (1)
- # sci (74)
- # specter (3)
- # tools-build (3)
- # tools-deps (5)
I have a theory question related to side effects. I have a side effect that needs to wait on certain state conditions before executing. I have a queue of message that build, and then once all of the app conditions are met I want to call a external lib to show them. Normally I would look to a effect to make the js call, but I can't do that directly from everywhere I add to the queue. The two things I can think of are to either 1. Call the JS from a sub that watches the conditions. This makes the sub impure though. 2. Create a small component that subscribes to the sub and calls the js from there. This is prone to recalling the js if something else causes a re-render. I like 1, but its always painful to make something impure like that.
Not exactly what I am doing but something like
(rf/reg-sub
::show-messages
:<- [:messages]
:<- [:wizard-done]
:<- [:user-settings-api-data]
(fn [[messages wizard-done user-settings-api-data]]
(when (and messages wizard-done user-settings-api-data)
(snackbar messages user-settings-api-data))))