sergdort / CombineFeedback

Unidirectional reactive architecture using new Apple Combine framework https://developer.apple.com/documentation/combine
MIT License
689 stars 53 forks source link

Discrepancy in the Examples #25

Open adriansergheev opened 4 years ago

adriansergheev commented 4 years ago

In the lib itself, the Reducer<State, Event> is a typealias, like so: public typealias Reducer<State, Event> = (inout State, Event) -> Void In the Examples however, they use a struct, with an init, like so:

` public let reduce: (inout State, Event) -> Void

public init(reduce: @escaping (inout State, Event) -> Void) {
    self.reduce = reduce
} etc...`

Where is the truth? :)

Thanks for the work on the library!

sergdort commented 4 years ago

Hey, it may be a mistake or a typo on my side the reducer now is a struct, I took this idea from Pointfree composable architecture https://github.com/sergdort/CombineFeedback/blob/master/Sources/CombineFeedback/Reducer.swift#L3

VNadygin commented 4 years ago

@sergdort I found the same issue. Then you install the library from Swift Package manager you have a different Reducer implementation. I would be so nice if you can update the package

maximkrouk commented 4 years ago

@VNadygin For now you can use .package(url: "git@github.com/sergdort/CombineFeedback.git", .branch("master"))

Btw today I figured out, that there is no example with navigating back programmatically 😢 (And I don't know yet how to handle it, yet, so maybe it's not too late to send feedback before I figure it out by myself 😎)

NSMyself commented 4 years ago

I'm seeing the same thing happening but regarding feedbacks. Pointing to master solved it, thanks @maximkrouk and @VNadygin

sergdort commented 4 years ago

Do I need to publish new version 🤔

sergdort commented 4 years ago

Also guys I'm a lacking free time lately. So if someone would like to be a maintainer I would love to create an org and move project there

NSMyself commented 4 years ago

@sergdort I don't have much nowadays but I'd gladly help out on what i can.

maximkrouk commented 4 years ago

I have migrated to the composable architecture btw 👽