Home > AI > IOS > Combine >

Publishers.MergeMany

Example :

let publishers: [Just<Int>] = [
    Just(1),
    Just(2),
    Just(3),
]

let cancellable = Publishers.MergeMany(publishers)
    .collect()
    .sink(receiveCompletion: {
        print("\($0)")
    }, receiveValue: {value in
        print(value)
    })

Leave a Reply