Hi! Is there a common idiom in Kotlin that helps a...
# announcements
s
Hi! Is there a common idiom in Kotlin that helps achieve something similar to this?
Copy code
// Java
private BehaviorRelay<Event> events = BehaviorRelay.create();

public Observable<Event> getEvents() {
	return events;
}
That is, I have a private property which I want to expose by its more general contract. Right now I have to use two fields:
Copy code
// Kotlin
private val _events: BehaviorRelay<Event> = BehaviorRelay.create()

val events: Observable<Event>
        get() = _events
I wonder if there’s a more convenient way of doing it.