createActionSubscriber

fun <T> createActionSubscriber(onNext: Action1<in T>, onError: Action1<Throwable> = Action1 {}, onCompleted: Action0 = Action0 {}): Subscriber<T>

Creates a subscriber that forwards the onXXX method calls to callbacks.

Return

ActionSubscriber instance

Parameters

onNext

An Observable calls this method whenever the Observable emits an item. This method takes as a parameter the item emitted by the Observable.

onError

An Observable calls this method to indicate that it has failed to generate the expected data or has encountered some other error.

onCompleted

An Observable calls this method after it has called onNext for the final time, if it has not encountered any errors.

See also