Jeffrey Rennie
Dec 16, 2024

--

Problem is, your DEFAULT instances are still mutable, and someone might accidentally write code that changes one. Finding that bug in your code would be a nightmare.

To avoid that nightmare, replace DEFAULT_PREFERENCES with a defaultUserPreferences() function that returns a new instance for each call.

--

--

No responses yet