Combine previous value using Combine
15:30 16 Sep 2020

How can I rewrite ReactiveSwift/ReactiveCocoa code using Combine framework? I attached screenshot what combinePrevious mean from docs.

let producer = SignalProducer([1, 2, 3]).combinePrevious(0)
producer.startWithValues { value in
    print(value) // print: (0, 1), (1, 2), (2, 3)
}

enter image description here

swift reactive-cocoa combine reactive-swift