Publishers.DropWhile
// Publishers.DropWhile Publisher
Publishers
.DropWhile(upstream: Publishers.Sequence<[Int], Never>(sequence: [1, 2, 3])) { $0 < 3 }
.sink(receiveCompletion: { completion in
switch completion {
case .failure:
print("Combine DropWhile Error")
case .finished:
print("Combine DropWhile Finish")
}
}, receiveValue: { value in
print("Combine DropWhile : \(value)")
})
.store(in: &cancellables)
// drop Operator
Publishers.Sequence<[Int], Never>(sequence: [1, 2, 3])
.drop { $0 < 3 }
.sink(receiveCompletion: { completion in
switch completion {
case .failure:
print("Combine DropWhile Error")
case .finished:
print("Combine DropWhile Finish")
}
}, receiveValue: { value in
print("Combine DropWhile : \(value)")
})
.store(in: &cancellables)
// Combine DropWhile : 3
// Combine DropWhile FinishRxSwift
ReactiveSwift
μ°Έκ³
Last updated