This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-07-29
Channels
- # babashka (64)
- # beginners (60)
- # calva (10)
- # circleci (3)
- # clj-kondo (62)
- # cljdoc (6)
- # clojars (2)
- # clojure (152)
- # clojure-europe (19)
- # clojure-nl (3)
- # clojure-uk (18)
- # clojurescript (50)
- # clojureverse-ops (12)
- # core-async (21)
- # cursive (6)
- # data-science (1)
- # datomic (17)
- # events (14)
- # fulcro (64)
- # graalvm (20)
- # graphql (5)
- # honeysql (14)
- # jackdaw (3)
- # jobs (1)
- # jobs-discuss (22)
- # kaocha (2)
- # lsp (9)
- # luminus (8)
- # malli (30)
- # meander (31)
- # other-languages (1)
- # polylith (8)
- # re-frame (15)
- # shadow-cljs (85)
- # specter (2)
- # sql (11)
- # tools-deps (56)
- # vim (39)
- # vscode (7)
- # xtdb (16)
I’ve got a very simple setup
(re-frame/reg-cofx
:now
(fn [coeffects _]
(assoc coeffects :now (js/Date.))))
(re-frame/reg-event-db
::initialize-db
[(re-frame/inject-cofx :now)]
(fn [args _]
(js/console.error args)
db/default-db))
but for some reason that coeffect isn’t showing up in ::initialize-db
in re-frisk, when I select this event, I can see this
{:event [:mutesync.inspect.electron.renderer.events/initialize-db],
:effects {:db {:name "re-frame"}},
:coeffects {:now #inst "2021-07-29T00:06:50.091-00:00"}}
but in the event handler the cofx map is empty, any ideas?Oh I see I need to use reg-event-fx
instead
funny how such obvious things can take so much time to figure out!
@U09FEH8GN long threads about this written - but my general advice is to always use reg-event-fx
Anyone have a re-frame.core/debug
equivalent for production. Something lighweight. Identifying paths in app-db which have changed due to event handler would probably be enough visibility to confirm intended/surprising behaviour.
debug
could be used in production, if you want to find such paths for some reason.
But what do you mean by "lightweight"?
Debug output doesn’t render for me without devtools. Serialising could be cpu intensive.
But maybe leveraging diff is an option
It doesn't serialize anything, no? It just sends the data as is to the console.
If you want something specific, the debug
code is just 20 lines of very simple code. Which indeed uses diff
. So you can just copy and paste it into your own code base and log the results in the way you prefer.
Are re-frame-10x and re-frisk both solving the same problem?
Or is it normal to have both in one project?
I’ve personally only seen one or the other used, not both. And most the time, it was 10x being used. They seem to offer the same major insights e.g. viewing app-db, subscriptions, events, etc. with (minor) differences here and there e.g. frisk seems to offer a graph visualization of subs that 10x does not.
got it thanks