ReplaySubject

public final class ReplaySubject<Output, Failure> : Subject where Failure : Error

The ShareReplay is used to share a single subscription to the upstream publisher and replay items emitted by that one.

  • Initialize a ReplaySubject subject with a buffer size

    Declaration

    Swift

    public init(_ bufferSize: Int = 0)
  • Provides this Subject an opportunity to establish demand for any new upstream subscriptions

    Declaration

    Swift

    public func send(subscription: Subscription)
  • Sends a value to the subscriber.

    Declaration

    Swift

    public func send(_ value: Output)
  • Sends a completion signal to the subscriber.

    Declaration

    Swift

    public func send(completion: Subscribers.Completion<Failure>)
  • This function is called to attach the specified Subscriber to the`Publisher

    Declaration

    Swift

    public func receive<Downstream>(subscriber: Downstream) where Output == Downstream.Input, Failure == Downstream.Failure, Downstream : Subscriber