27 Mayıs 2021 Perşembe

RxJava Subjects

Giriş
Açıklaması şöyle
A Subject extends an Observable and implements Observer at the same time. It acts as an Observable to clients and registers to multiple events taking place in the app. It acts as an Observer by broadcasting the event to multiple subscribers.
Peki Subject neden Observable'a abone olup tekrar Observable hale getiriyor. Buradaki amaçlardan bir tanesi şu
Subjects are considered as HOT Observables.

A HOT Observable, such as Subjects, emits items only once regardless of number of subscribers and its subscribers receive items only from the point of their subscription. Subjects convert cold observable into hot observable.
Bir çok Subject gerçekleştirimi var. Bunlar şöyle

Hiç yorum yok:

Yorum Gönder