This repository has been archived by the owner on Jul 16, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Migrate LiveData to Flow #68
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Goooler
commented
Mar 23, 2022
Comment on lines
+22
to
+26
|
||
val repoDetailModel: StateFlow<RepoDetailModel> | ||
get() = _repoDetailModel.asStateFlow() | ||
val isRefreshing: StateFlow<Boolean> | ||
get() = _isRefreshing.asStateFlow() |
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.
Follow up #57 (comment).
Goooler
commented
Apr 4, 2022
|
||
@AnyThread | ||
override fun showLoading() { | ||
loading.postValue(true) | ||
_loading.value = true |
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.
The current value of this state flow.
Setting a value that is equal to the previous one does nothing.
This property is thread-safe and can be safely updated from concurrent coroutines without external synchronization.
# Conflicts: # detail/src/main/kotlin/io/goooler/demoapp/detail/ui/RepoDetailActivity.kt
Rebased from #75. |
Goooler
commented
Apr 5, 2022
Comment on lines
-270
to
-183
@MainThread | ||
inline fun <reified V, reified VM : BaseViewModel> V.baseViewModels(): Lazy<VM> | ||
where V : LifecycleOwner, V : ViewModelStoreOwner = lazy(LazyThreadSafetyMode.NONE) { | ||
ViewModelProvider(this)[VM::class.java].apply(lifecycle::addObserver) | ||
} | ||
|
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.
Follow up #75 (comment).
# Conflicts: # common/src/main/kotlin/io/goooler/demoapp/common/util/CommonExtensions.kt # obsolete/src/main/kotlin/io/goooler/demoapp/obsolete/util/ObsoleteExtensions.kt
Merged
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://juejin.cn/post/7078225994871472158