Skip to content

Commit b79c5d0

Browse files
committed
Debounce.kt: Don't inline debounced util
There seems to be some weird runtime issues when inlining this method for whatever reason
1 parent ff2a367 commit b79c5d0

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • utils/androidx/compose/src/main/kotlin/com/edricchan/studybuddy/exts/androidx/compose

utils/androidx/compose/src/main/kotlin/com/edricchan/studybuddy/exts/androidx/compose/Debounce.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ import kotlin.time.Duration.Companion.milliseconds
1919
* @return Wrapped lambda to be used in code where a lambda is expected.
2020
*/
2121
@Composable
22-
inline fun debounced(
22+
fun debounced(
2323
debounceTime: Duration = 500.milliseconds,
24-
crossinline getElapsedRealTimeMillis: () -> Long = SystemClock::elapsedRealtime,
25-
crossinline onClick: () -> Unit
24+
getElapsedRealTimeMillis: () -> Long = SystemClock::elapsedRealtime,
25+
onClick: () -> Unit
2626
): () -> Unit {
2727
var lastClickTime by remember { mutableLongStateOf(getElapsedRealTimeMillis()) }
2828
return {

0 commit comments

Comments
 (0)