Skip to content

Commit f523d2b

Browse files
committed
detekt
1 parent 20b9ff2 commit f523d2b

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

sample/app/src/main/java/com/hoc081098/channeleventbus/sample/android/common/CollectWithLifecycleEffect.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,15 @@ import kotlinx.coroutines.launch
2121
/**
2222
* Collect the given [Flow] in an effect that runs when [LifecycleOwner.lifecycle] is at least at [minActiveState].
2323
*
24-
* If [inImmediateMain] is `true`, the effect will run in [Dispatchers.Main.immediate][kotlinx.coroutines.MainCoroutineDispatcher.immediate],
24+
* If [inImmediateMain] is `true`, the effect will run in
25+
* [Dispatchers.Main.immediate][kotlinx.coroutines.MainCoroutineDispatcher.immediate],
2526
* otherwise it will run in [androidx.compose.runtime.Composer.applyCoroutineContext].
2627
*
2728
* @param keys Keys to be used to [remember] the effect.
2829
* @param lifecycleOwner The [LifecycleOwner] to be used to [repeatOnLifecycle].
2930
* @param minActiveState The minimum [Lifecycle.State] to be used to [repeatOnLifecycle].
30-
* @param inImmediateMain Whether the effect should run in [Dispatchers.Main.immediate][kotlinx.coroutines.MainCoroutineDispatcher.immediate].
31+
* @param inImmediateMain Whether the effect should run in
32+
* [Dispatchers.Main.immediate][kotlinx.coroutines.MainCoroutineDispatcher.immediate].
3133
* @param collector The collector to be used to collect the [Flow].
3234
*
3335
* @see [LaunchedEffect]

sample/app/src/main/java/com/hoc081098/channeleventbus/sample/android/ui/home/detail/DetailVM.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class DetailVM(
4141

4242
init {
4343
fun process(): Flow<Unit> = flowFromSuspend {
44-
delay(500) // simulate a long-running task
44+
delay(@Suppress("MagicNumber") 500) // simulate a long-running task
4545

4646
textStateFlow.value
4747
.toNonBlankString()

sample/app/src/main/java/com/hoc081098/channeleventbus/sample/android/utils/launchNow.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import kotlinx.coroutines.launch
1212
* Launch a coroutine immediately to collect the flow.
1313
* It is a shortcut for `scope.launch(CoroutineStart.UNDISPATCHED) { flow.collect() }`.
1414
*
15-
* This differs from [kotlinx.coroutines.flow.launchIn] in that the collection is started immediately _in the current thread_
15+
* This differs from [kotlinx.coroutines.flow.launchIn] in that the collection is started immediately
16+
* _in the current thread_
1617
* until the first suspension point, without dispatching to the [CoroutineDispatcher] of the scope context.
17-
* However, when the coroutine is resumed from suspension, it is dispatched according to the [CoroutineDispatcher] in its context.
18+
* However, when the coroutine is resumed from suspension, it is dispatched to the [CoroutineDispatcher] in its context.
1819
*
1920
* This is useful when collecting a [kotlinx.coroutines.flow.SharedFlow] which does not replay or buffer values,
2021
* and you don't want to miss any values due to the dispatching to the [CoroutineDispatcher].

0 commit comments

Comments
 (0)