Classes

The following classes are available globally.

  • # PassthroughValidatedSubject

    A Combine Subject that you send values to and it will send validated objects only to downstream subscribers.

         let subject = PassthroughValidatedSubject(String.self) {
             !.empty && .count(3...)
         }
    
         let cancellable = subject.sink { print($0) }
    
         subject.send("foo-bar")
         // foo-bar
    
         subject.send("")
         // does not get sent to downstreams.
    
    See more

    Declaration

    Swift

    public final class PassthroughValidatedSubject<T> : ValidatedSubject<T, PassthroughSubject<T, Never>>
  • ValidatedSubject

    A base class that can be used to wrap any Subject type and sends validated objects to downstream subscribers.

    See more

    Declaration

    Swift

    public class ValidatedSubject<T, S> : Subject where T == S.Output, S : Subject, S.Failure == Never