collect()
-
Ch3. Transforming OperatorsRay Wenderlich/Combine 2021. 1. 27. 20:26
collect() ["A", "B", "C", "D", "E"].publisher .collect() .sink(receiveCompletion: { print($0) }, receiveValue: { print($0) }) .store(in: &subscriptions) // collect에 parameter전달하여 메모리 과다사용 방지 ["A", "B", "C", "D", "E"].publisher.collect(3) .sink(receiveCompletion: { print($0) }, receiveValue: { print($0) }) .store(in: &subscriptions) ["A", "B", "C", "D", "E"] finished ["A", "B", "C"] ["D", "E"] fi..