How to correctly initialize a view model in SwiftUI: https://chris.eidhof.nl/post/swiftui-view-model/ (for when the view needs ownership of the view model).
SwiftUI View Model Ownership — Chris Eidhof

@chris In the fixed example, is it correct to say that an instance of the view model object will be needlessly created each time the view’s initializer is called by the parent? As in: when you change the selected room in the parent, the child’s initializer is run, name is set to the new name, the view model object is created and then not used (because of the attribute graph as you mentioned), and then the “original” view model is replaced by a third inside of onChanged?
@kyle @chris yes, that is correct
@shadowfacts @kyle yes! Good catch. I think that should be fixed, don't know the proper solution yet... I'll have a think.
@shadowfacts @kyle I added a note to the post just now (should be live in a minute). Thank you!
@chris @shadowfacts You’re doing yeoman’s work, thank you. My ulterior motive for confirming that detail is I that I am coming to the conclusion—and want to learn how to communicate—that this pattern of view models are implicitly discouraged by Apple and SwiftUI, based on the worsening ergonomics of using them.
@kyle @shadowfacts yeah I don't hold strong opinions there, but people *really* want to initialize in init. I wrote the post more so that when I see that happening, I have a "short" explanation that is linkable :).