Fork me on GitHub
#helix
<
2020-07-13
>
Aron18:07:51

have you ever used React.useDebugValue with helix?

lilactown18:07:36

is there a specific question you have about it?

Aron18:07:31

no, just curious

Aron18:07:13

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.

Aron18:07:55

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.

Aron18:07:18

So maybe this useDebugValue will, I am not sure

dominicm18:07:52

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.

Aron18:07:03

Yeah, I know half a dozen obvious ways to avoid this, but I was probably too lazy at the time to argue. Not again. If I see something as too complicated, I will deal with it as such, no matter what bosses say.

Aron18:07:34

It's just that at the time this seemed like a minor matter. Not so now when I just want to get over it but I can't.