Skip to content

Commit

Permalink
Add a better comment (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Schwab authored Mar 20, 2019
1 parent 2d7efa4 commit 60afc38
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mvrx/src/main/kotlin/com/airbnb/mvrx/MvRxView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ interface MvRxView : MvRxViewModelStoreOwner, LifecycleOwner {
* the fragment's lifecycle owner so that the subscriptions are cleared in `onDestroy`. Subscriptions made in or after
* `onCreateView` should use the fragment's _view's_ lifecycle owner so that they are cleared in `onDestroyView`.
*
* By default this is the same as the view's standard lifecycle owner.
* For example, if you are using a fragment as a MvRxView the proper implementation is:
* ```
* override val subscriptionLifecycleOwner: LifecycleOwner
* get() = this.viewLifecycleOwnerLiveData.value ?: this
* ```
*
* By default [subscriptionLifecycleOwner] is the same as the MvRxView's standard lifecycle owner.
*/
val subscriptionLifecycleOwner : LifecycleOwner
get() = this
Expand Down

0 comments on commit 60afc38

Please sign in to comment.