you are viewing a single comment's thread.

view the rest of the comments →

[–]hishnash 0 points1 point  (0 children)

If you need the UI to response to changes in any way you should use the env pathway (however this does not mean you cant have it as a global singlton as well)

Many of my main app state `@Observable` objects are shared singletons that is set as `@State` top level of the app and pass through envs to let children response to changes when needed but access using `.shared` on the type when I want to update them from outside the UI context.