subscribe

fun subscribe(onSuccess: (T) -> Unit, onError: (Throwable) -> Unit = {}, thread: DataObserver.Thread = Thread.Main): DataObserver<T>

This will allow users to subscribe for data

Parameters

onSuccess

this will be called only when data has successfully been retrieve

onError

this will be called only when a throwable has been thrown

thread

allows you to set which thread data should be return to. Default is main.