Skip to content

Instantly share code, notes, and snippets.

@jasdev
Last active April 20, 2020 15:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasdev/be106d7a1ad9668cd6a6ea58ff90fb3c to your computer and use it in GitHub Desktop.
Save jasdev/be106d7a1ad9668cd6a6ea58ff90fb3c to your computer and use it in GitHub Desktop.
`ReplaySubject` start.
final class ReplaySubject: Subject {
typealias Output = /* … */ /// (1) The `Subject` itself won’t know its `Output` and `Failure` types,
/// but callers will. So, we can add generics for the two, following `PassthroughSubject` and
/// `CurrentValueSubject`’s lead.
typealias Failure = /* … */ /// (2) Same as in `(1)`.
private let bufferSize: Int
init(bufferSize: Int) {
self.bufferSize = bufferSize
}
func send(subscription: Subscription) { /* … */ }
func send(completion: Subscribers.Completion<Failure>) { /* … */ }
func send(_ value: Output) { /* … */ }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment