Group Group Group Group Group Group Group Group Group

Query about the MVP pattern (Chapter 8 - AAAA)

In the chapter MVP, in MainPresenter.kt, it is written

val observer: DisposableObserver<List<Movie>>
    get() = object : DisposableObserver<List<Movie>>() 

but this means that each get call to observer will create new Object for DisposableObserver. Why is that? Shouldn’t the object be initialized one time and would be reused? Also due to this the member becomes property of the class and will not have global scope which may result in garbage collection. Correct me if I am wrong.

Thanks,

@yuncheng13 Can you please help with this when you get a chance? Thank you - much appreciated! :]