com.noheltcj.rxcommon.operators.Operator.kt Maven / Gradle / Ivy
package com.noheltcj.rxcommon.operators
import com.noheltcj.rxcommon.Source
import com.noheltcj.rxcommon.emitters.Emitter
import com.noheltcj.rxcommon.observers.Observer
abstract class Operator : Source, Observer {
abstract val emitter: Emitter
override fun onNext(value: E) {
emitter.next(value)
}
override fun onError(throwable: Throwable) {
emitter.terminate(throwable)
}
override fun onComplete() {
emitter.complete()
}
}