Publishers.MapKeyPath
struct SomeStruct {
let property = "value"
}
Just(SomeStruct())
.map(\.property)
.sink(receiveCompletion: { completion in
switch completion {
case .failure:
print("Combine MapKeyPath Error")
case .finished:
print("Combine MapKeyPath Finish")
}
}, receiveValue: { value in
print("Combine MapKeyPath : \(value)")
})
.store(in: &cancellables)
// Combine MapKeyPath : value
// Combine MapKeyPath FinishRxSwift
ReactiveSwift
Last updated