package Ġcom . jj h . react Ċ Ċ import Ġio . reactivex . rx java 3 . core . Observable Ċ import Ġio . reactivex . rx java 3 . kotlin . subscribe By Ċ import Ġio . reactivex . rx java 3 . kotlin . to Observable Ċ import Ġio . reactivex . rx java 3 . subjects . Publish Subject Ċ import Ġio . reactivex . rx java 3 . subjects . Replay Subject ĊĊ Ċ fun Ġmain ( args : ĠArray < String >) Ġ{ ĊĠĠĠ Ġval Ġlist Ġ= ĠlistOf (" John ", Ġ" Den ise ", Ġ" Ph oe be ", Ġ" G ry ff ", Ġ" Adam ", Ġ" J asmine ") ĊĠĠĠ Ġprintln ( list ) ĊĠĠĠ Ġval Ġobservable : ĠObservable < String > Ġ= Ġlist . to Observable () ĊĊĠĠĠ Ġval Ġsubject : ĠRe play Subject < String > Ġ= ĠRe play Subject . create < String >() ĊĠĠĠ Ġ// val Ġsubject : ĠPublish Subject < String > Ġ= ĠPublish Subject . create < String >() ĊĠĠĠ Ġsubject . subscribe By { println (" first Ġobserver : Ġ$ it ")} ĊĊĠĠĠ Ġobservable . subscribe ( subject ) ĊĊĠĠĠ Ġsubject . subscribe By Ġ{ Ġprintln (" second Ġobserver : Ġ$ it ") Ġ} Ċ } Ċ