Discussion

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

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).

1 points Pistos2 7 years ago 0 comments

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton