Dimillian / SwiftUIFlux

A very naive implementation of Redux using Combine BindableObject to serve as an example
Apache License 2.0
654 stars 62 forks source link

Store provider refactored. #3

Closed mecid closed 5 years ago

mecid commented 5 years ago

Store provider refactored to be ViewModifier instead of View

Dimillian commented 5 years ago

Thanks for the idea!

Sure it feels more SwiftUI, but this is just a syntaxic sugar over .envObject now, and in the future, I may plan to evolve the StoreProvider struct.

mecid commented 5 years ago

@Dimillian I've fixed tests. Yeah, basically it is the same result, but with approach more similar to SwiftUI. We can skip it if the main idea is to have API similar to Redux.

Dimillian commented 5 years ago

Yeah, even if it's not the best SwiftUI approach, I prefer to keep it closer to Redux syntax, as this will look familiar to many people coming here. I like the approach thought :)