Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Cleanup generic functions & classes #58

Merged
merged 4 commits into from
Mar 17, 2022
Merged

Cleanup generic functions & classes #58

merged 4 commits into from
Mar 17, 2022

Conversation

Goooler
Copy link
Owner

@Goooler Goooler commented Mar 17, 2022

No description provided.

Comment on lines +186 to 199
fun <T : Any> Single<T>.subscribeOnIoThread(): Single<T> = subscribeOn(Schedulers.io())

fun <T> Single<T>.observeOnMainThread(): Single<T> = observeOn(AndroidSchedulers.mainThread())
fun <T : Any> Single<T>.observeOnMainThread(): Single<T> = observeOn(AndroidSchedulers.mainThread())

fun <T> Single<T>.subscribeAndObserve(): Single<T> =
fun <T : Any> Single<T>.subscribeAndObserve(): Single<T> =
subscribeOnIoThread().observeOnMainThread()

fun <T> Observable<T>.subscribeOnIoThread(): Observable<T> = subscribeOn(Schedulers.io())
fun <T : Any> Observable<T>.subscribeOnIoThread(): Observable<T> = subscribeOn(Schedulers.io())

fun <T> Observable<T>.observeOnMainThread(): Observable<T> =
fun <T : Any> Observable<T>.observeOnMainThread(): Observable<T> =
observeOn(AndroidSchedulers.mainThread())

fun <T> Observable<T>.subscribeAndObserve(): Observable<T> =
fun <T : Any> Observable<T>.subscribeAndObserve(): Observable<T> =
subscribeOnIoThread().observeOnMainThread()
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link #32.

@Goooler Goooler changed the title Prevent nullable generic types Cleanup generic functions & classes Mar 17, 2022
@Goooler Goooler added this to the 1.6.0 milestone Mar 17, 2022
@Goooler Goooler merged commit 06e326a into trunk Mar 17, 2022
@Goooler Goooler deleted the gt branch March 17, 2022 08:06
@Goooler Goooler mentioned this pull request Apr 10, 2022
3 tasks
@Goooler Goooler mentioned this pull request Apr 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant