Closed kelvinlauKL closed 5 years ago
I really like this. I think we can build on it and iterate on it. This gave me an idea for how to combine MVVM, use cases, and a bit of Redux for a really nice clean architecture. Go ahead and merge this in and I'll raise some PRs branching off.
Checklist
Description
Been doing some experimentation on having SwiftUI views to depend on an abstract model. The model could then be injected and have mock representations for testing.
Pros to this approach
Bindable
propertiesCons
Binding<Value>
requires a backing property; You will need a separate variable to hold the state of theBinding
:Binding
(binding requires a way to mutate some backing property, which violates the value semantics of the struct)Asking for opinions on whether this is a good idea or not. Relevant thread with some opinions from Joe Groff: https://forums.swift.org/t/state-messing-with-initializer-flow/25276/8