Subject that publishes only the last item observed to each Observer that has subscribed, when the
source Observable} completes.
Example:
// observer will receive no onNext events because the subject.onCompleted() isn't called.val subject = AsyncSubject[String]()
subject.subscribe(observer)
subject.onNext("one")
subject.onNext("two")
subject.onNext("three")
// observer will receive "three" as the only onNext event.val subject = AsyncSubject[String]()
subject.subscribe(observer)
subject.onNext("one")
subject.onNext("two")
subject.onNext("three")
subject.onCompleted()
Subject that publishes only the last item observed to each
Observerthat has subscribed, when the sourceObservable}completes.