4 ms·
> Singleton isn't bad if it is used only for reading the data. Mutable global state is the problem. If it’s read-only, you can just declare it as a constant. N
by cnasc 6y ago
> Singleton isn't bad if it is used only for reading the data. Mutable global state is the problem.
If it’s read-only, you can just declare it as a constant. No need to add a state management library.
- brulard 6y agoRead-only != constant. State management library can provide you with globally readable state represented by stream of immutable values.