Closed toddwbates closed 3 years ago
I just saw episode 99 and you already have bindings. I suspect next week will cover the rest;-)
Thanks for starting the discussion, and sorry for not seeing till now! 😄 Going to move over to the discussions tab.
Adding the scope function allows views to deal exclusively with ViewState objects. This simplifies usage because Views are passed the object they actually use rather than having to transform the Store into a ViewStore. This also simplifies ownership.
I have also added utility methods to ViewStore for bindings that allow snapshot tests to report full coverage. For example in Counter.swift line 183
would not be reported as full coverage because of the closure while this is
The same with CounterView_macO line 57
.popover( isPresented: Binding( get: { self.viewStore.value.isPrimePopoverShown }, set: { _ in self.viewStore.send(.primePopoverDismissed) } )
becomes
I have a fork with the changes here,
https://github.com/toddwbates/episode-code-samples