Replaces nil elements in the stream with the provided element.
SDKs
- iOS 13.0+
- macOS 10.15+
- Mac Catalyst 13.0+
- tvOS 13.0+
- watchOS 6.0+
- Xcode 11.0+
Framework
- Combine
Declaration
func replaceNil<T>(with output: T) -> Publishers.Map<Publishers.Set Failure Type<Upstream, Failure>, T> where Self.Output == T?
Parameters
output
The element to use when replacing
nil
.
Return Value
A publisher that replaces nil
elements from the upstream publisher with the provided element.