I am trying to understand Record Publisher.
Here is an example to better understand the case:
var subscriptions = [AnyCancellable]() let pub = Record<Int, Never>(output: [1, 101, 102, 1001, 1002], completion: .finished) // I have used here one of 3 possible inits for that Publisher, and I would like to use exactly that specific one. DispatchQueue.main.asyncAfter(deadline: .now() + 2) { pub.sink { print(">>>1 \($0)") } .store(in: &self.subscriptions) } pub.sink { print(">>>2 \($0)") } .store(in: &subscriptions) Output:
>>>2 1 >>>2 101 >>>2 102 >>>2 1001 >>>2 1002 >>>1 1 >>>1 101 >>>1 102 >>>1 1001 >>>1 1002
But I don't understand this: where is the part when we record stream of inputs and later it is called for a new subscriptions? For me it would be totally the same using [1, 101, 102, 1001, 1002].publisher.
Sequence.Publisher?