top | item 21399098

Ask HN: If global variables are bad, why are JavaScript data stores okay?

1 points| Pistos2 | 6 years ago

By "stores" I mean things like Redux, Vuex, ngRx.

I've been using Vuex for a while now, and haven't had any major problems (yet), so, instinctively, based on experience, I feel like these centralized data stores are okay. Yet, I don't think I could make a solid, detailed argument in their favour given the reasons why global variables are bad (e.g. globals increase coupling; globals increase number of potential culprits when debugging).

discuss

order

No comments yet.