-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RxLifecycle Extensions #353
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but address comments before merging
/** | ||
* Extension that converts a [LifecycleProvider] to [ScopeProvider]. | ||
*/ | ||
fun <E> LifecycleProvider<E>.toScopeProvider(event: E? = null): ScopeProvider { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inline. Also - convention is to call this scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@CheckReturnValue | ||
inline fun <T, E> Flowable<T>.autoDisposable(lifecycleProvider: LifecycleProvider<E>, event: E? = null): FlowableSubscribeProxy<T> { | ||
return if (event == null) { | ||
this.`as`(AutoDispose.autoDisposable(RxLifecycleInterop.from(lifecycleProvider))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we reuse the toScopeProvider
function for all of these impls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} | ||
|
||
override fun <T : Any?> bindUntilEvent(event: Event): LifecycleTransformer<T> { | ||
TODO("not implemented") // To change body of created functions use File | Settings | File Templates. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's stub these with a more descriptive TODO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
D'oh that's right. Will update. |
No description provided.