Skip to content

Commit

Permalink
Fixed asConsumer signature
Browse files Browse the repository at this point in the history
  • Loading branch information
LachlanMcKee committed Apr 4, 2024
1 parent e67128e commit e2985d4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import io.reactivex.ObservableSource
import io.reactivex.Observer
import io.reactivex.subjects.PublishSubject

abstract class ObservableSourceActivity<T> : DebugActivity(), ObservableSource<T> {
abstract class ObservableSourceActivity<T : Any> : DebugActivity(), ObservableSource<T> {

private val source = PublishSubject.create<T>()

Expand Down
2 changes: 1 addition & 1 deletion mvicore/src/main/java/com/badoo/mvicore/extension/Rx.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import io.reactivex.Observer
import io.reactivex.Scheduler
import io.reactivex.functions.Consumer

fun <T> Observer<T>.asConsumer() = Consumer<T> { onNext(it) }
fun <T : Any> Observer<T>.asConsumer() = Consumer<T> { onNext(it) }

internal fun <T> Observable<T>.subscribeOnNullable(scheduler: Scheduler?): Observable<T> =
if (scheduler != null) subscribeOn(scheduler) else this

0 comments on commit e2985d4

Please sign in to comment.