This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-14
Channels
- # announcements (10)
- # babashka (14)
- # beginners (51)
- # calva (2)
- # cider (28)
- # cljs-dev (1)
- # cljsrn (3)
- # clojure (185)
- # clojure-dev (15)
- # clojure-europe (6)
- # clojure-italy (2)
- # clojure-nl (6)
- # clojure-uk (45)
- # clojurescript (4)
- # conjure (12)
- # datomic (37)
- # duct (37)
- # figwheel-main (15)
- # helix (23)
- # interceptors (1)
- # jobs (1)
- # jobs-discuss (11)
- # jvm (5)
- # luminus (3)
- # malli (15)
- # off-topic (69)
- # pathom (8)
- # pedestal (2)
- # re-frame (7)
- # reagent (58)
- # reitit (33)
- # remote-jobs (1)
- # rum (14)
- # sci (7)
- # shadow-cljs (15)
- # spacemacs (9)
- # testing (19)
- # timbre (3)
- # tools-deps (14)
We are using atoms and subscription to the atoms. It’s not really global (it’s in a var in a namespace) but you don’t have to think about passing dispatch functions around.
In practice it ends up being a stateful component that subscribed to state, and just renders a stateless one.
After a few rounds of polish I will document reseda a bit more and make a release of sorts.
That is another thing I could've done, to use clojurescript's own state management mechanism so I have access to easy debugging through the REPL. Even though I can manually extract react hook values through the react dev tools, it's not very convenient to do so repeatedly. Too much clicking.
we started with a large re-frame app, and are adopting helix and putting most things in local state
the only thing that doesn’t go in local state is routing (we already had a routing solution) and data from the backend
using React DevTools to find the component and then logging them to the console for inspection of the CLJS data
@dpassen1 how do I use tap> to investigate the contents of a react hook? I have never used tap> before, I am not even sure what it is, people talk about it like it's common wisdom
@lilactown that's what I do, and (js-debugger)
but it's extremely cumbersome and time consuming, I would not like to continue to debug like this.
@dpassen1 but that's the thing, console log is not adequate for this, I need to see live data from clojures without having to manually decorate it with calls like (prn)
What @lilactown says is very useful here because there is a top-down direction of selecting which components' which hook to inspect at any time when I have a breakpoint or anything. I am not aware that I can introduce new console.log calls when execution is suspended