Fix warnings after library upgrade
This commit is contained in:
parent
1058bfecf4
commit
6c56b5f45b
|
@ -43,7 +43,7 @@ abstract class VectorViewModel<S : MvRxState, VA : VectorViewModelAction, VE : V
|
||||||
* so you can use this in a switchMap or a flatMap
|
* so you can use this in a switchMap or a flatMap
|
||||||
*/
|
*/
|
||||||
// False positive
|
// False positive
|
||||||
@Suppress("USELESS_CAST")
|
@Suppress("USELESS_CAST", "NULLABLE_TYPE_PARAMETER_AGAINST_NOT_NULL_TYPE_PARAMETER")
|
||||||
fun <T> Single<T>.toAsync(stateReducer: S.(Async<T>) -> S): Single<Async<T>> {
|
fun <T> Single<T>.toAsync(stateReducer: S.(Async<T>) -> S): Single<Async<T>> {
|
||||||
setState { stateReducer(Loading()) }
|
setState { stateReducer(Loading()) }
|
||||||
return map { Success(it) as Async<T> }
|
return map { Success(it) as Async<T> }
|
||||||
|
@ -56,7 +56,7 @@ abstract class VectorViewModel<S : MvRxState, VA : VectorViewModelAction, VE : V
|
||||||
* so you can use this in a switchMap or a flatMap
|
* so you can use this in a switchMap or a flatMap
|
||||||
*/
|
*/
|
||||||
// False positive
|
// False positive
|
||||||
@Suppress("USELESS_CAST")
|
@Suppress("USELESS_CAST", "NULLABLE_TYPE_PARAMETER_AGAINST_NOT_NULL_TYPE_PARAMETER")
|
||||||
fun <T> Observable<T>.toAsync(stateReducer: S.(Async<T>) -> S): Observable<Async<T>> {
|
fun <T> Observable<T>.toAsync(stateReducer: S.(Async<T>) -> S): Observable<Async<T>> {
|
||||||
setState { stateReducer(Loading()) }
|
setState { stateReducer(Loading()) }
|
||||||
return map { Success(it) as Async<T> }
|
return map { Success(it) as Async<T> }
|
||||||
|
|
|
@ -44,7 +44,7 @@ open class BehaviorDataSource<T>(private val defaultValue: T? = null) : MutableD
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun post(value: T) {
|
override fun post(value: T) {
|
||||||
behaviorRelay.accept(value)
|
behaviorRelay.accept(value!!)
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun createRelay(): BehaviorRelay<T> {
|
private fun createRelay(): BehaviorRelay<T> {
|
||||||
|
@ -68,6 +68,6 @@ open class PublishDataSource<T> : MutableDataSource<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun post(value: T) {
|
override fun post(value: T) {
|
||||||
publishRelay.accept(value)
|
publishRelay.accept(value!!)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue