Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example for ReplaySubject
let subject = ReplaySubject<Int>.create(bufferSize: 5)
subject.onNext(1)
subject.onNext(2)
subject.onNext(3)
subject.onNext(4)
subject.onNext(5)
subject.onNext(6)
subject.subscribe(onNext: { value in
print(value)
}).addDisposableTo(disposeBag)
subject.onNext(7)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment