Publishers
@available(OSX 10.15, iOS 13.0, tvOS 13.0, watchOS 6.0, *)
extension Publishers
-
TryValidatedPublisher
A top level publisher that passes validated values or
BasicValidationError
to downstream subscribers.
See more``` _ = TryValidatedPublisher("foo-bar", !.empty && .count(3...)) .replaceError(with: "Failed" .sink { print($0) } // "foo-bar" ```
Declaration
Swift
public struct TryValidatedPublisher<T> : Publisher
-
ValidationPublisher
A top level publisher that passes validated values or
nil
to downstream subscribers.
See more``` _ = ValidatedPublisher("foo-bar", !.empty && .count(3...)) .replaceNil(with: "Failed" .sink { print($0) } // "foo-bar" ```
Declaration
Swift
public struct ValidatedPublisher<T> : Publisher