AI-powered
podcast player
Listen to all your favourite podcasts with AI-powered features
Is There a Way to Avoid Global State?
I would actually do away with global state altogether. If you're going to try and sort of mock it or something, it'll interfere with it in weird ways. I think that the key is with usages of global state that aren't bad is they're essentially constant. So some of those, you can't actually use the const keyword because for example, the file store has to be a fs variable so there's no such thing as anfs constant. But once the application starts up, you're not changing it. You're not modifying it. Yeah. It probably shouldn't live at the package level after if you're modifying it after startup. That's pretty much a very clear bright