This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-07-13
Channels
- # babashka (5)
- # beginners (55)
- # calva (24)
- # cider (11)
- # cljsrn (14)
- # clojure (55)
- # clojure-europe (9)
- # clojure-houston (1)
- # clojure-italy (1)
- # clojure-nl (7)
- # clojure-uk (38)
- # clojurescript (4)
- # code-reviews (12)
- # cursive (3)
- # datomic (86)
- # figwheel-main (14)
- # helix (10)
- # hoplon (4)
- # interceptors (1)
- # jobs (2)
- # jobs-discuss (13)
- # kaocha (5)
- # leiningen (5)
- # local-first-clojure (1)
- # luminus (2)
- # malli (27)
- # membrane (1)
- # off-topic (43)
- # pedestal (5)
- # re-frame (32)
- # reagent (22)
- # reitit (24)
- # remote-jobs (2)
- # shadow-cljs (1)
- # spacemacs (1)
- # sql (1)
- # tools-deps (32)
- # xtdb (51)
I am this really shitty position that I didn't open my mouth in time and let myself slowly get somewhere where it's extremely hard to debug my app. Basically, I was saying we need some kind of proper state management thing, at least a central useReducer or something, so that it's easier to debug/maintain the app. My boss said that no, just do simple hooks because this is a simple thing, we don't need to centralize the state, just do it as I go. Well, I was done earlier, in this he was probably right, but now I am having incredibly frustrating bugs where on some interaction there are remote calls and in their handler I clear some data that I should keep, but I don't even know which call hook is that.
If I had been more adamant this would've been avoidable, but now I am looking desperately for anything that helps me find where the state is being cleared.
I've had a few mishaps like this with local state. I've made a conscious effort to hoist up state and write my components to fire semantic callbacks ("onChangeXXX" instead of direct state access). It makes it much easier to coordinate state, but also reduce the number of useEffect dramatically.