diff --git a/dachlatten-flow/src/main/kotlin/de/sipgate/dachlatten/flow/SharingStartedExt.kt b/dachlatten-flow/src/main/kotlin/de/sipgate/dachlatten/flow/SharingStartedExt.kt new file mode 100644 index 0000000..61e4f8c --- /dev/null +++ b/dachlatten-flow/src/main/kotlin/de/sipgate/dachlatten/flow/SharingStartedExt.kt @@ -0,0 +1,8 @@ +package de.sipgate.dachlatten.flow + +import kotlinx.coroutines.flow.SharingStarted +import kotlin.time.Duration + +fun SharingStarted.WhileSubscribed(duration: Duration): SharingStarted { + return SharingStarted.WhileSubscribed(stopTimeoutMillis = duration.inWholeMilliseconds) +}