livestream-kt / dev.shreyaspatil.livestream.extension

Package dev.shreyaspatil.livestream.extension

Functions

subscribe

Subscribes to the given stream. The events are dispatched on the main thread. If stream already has data set, it will be delivered to the listener. You should call LiveStream.unsubscribe to stop observing LiveStream.

fun <T : Any> LiveStream<T>.subscribe(stream: String, onChangeCallback: (T?) -> Unit): StreamObserver<T>