Combine's Sequence Publisher Missing First Element
Just had a fun run in with a bug in Combine. Any Sequence can produce a Publisher that publishes each element in the sequence when you subscribe to it. You might have a custom sequence implementation that counts from 1 to 9: final class Incrementer { var value = 0 func next() -> Int? { value += 1 guard value < 10 else { return nil } return value } } extension Incrementer: Sequence { func makeIterator() -> AnyIterator<Int> { return AnyIterator { self.
Read more...