Compare commits

...

3 Commits
0.6.5 ... 0.6.6

Author SHA1 Message Date
ea7fab6130 0.6.6 2021-11-12 16:06:08 +06:00
2f3796733d Hotfix for 0.6.5 flows 2021-09-26 14:17:01 +06:00
89a6a305f8 Merge pull request #23 from InsanusMokrassar/0.6.5
0.6.5
2021-09-26 14:08:01 +06:00
3 changed files with 18 additions and 26 deletions

View File

@@ -1,5 +1,11 @@
# Changelog
## 0.6.6
* Versions
* `Klock`: `2.4.8`
* `Androidx Work`: `2.7.0`
## 0.6.5
* Flows now use `doWhile` functions

View File

@@ -11,9 +11,9 @@ android.enableJetifier=false
kotlin_version=1.5.31
kotlin_coroutines_version=1.5.2
dokka_version=1.5.30
dokka_version=1.5.31
klockVersion=2.4.2
klockVersion=2.4.8
## Github reease
@@ -29,9 +29,9 @@ junit_version=4.12
test_ext_junit_version=1.1.2
espresso_core=3.3.0
androidx_work_version=2.6.0
androidx_work_version=2.7.0
## Common
version=0.6.5
android_code_version=9
version=0.6.6
android_code_version=10

View File

@@ -12,12 +12,12 @@ import kotlinx.coroutines.flow.*
* time zones
*
* @see channelFlow
* @see KronSchedulerTz.doWhile
* @see KronSchedulerTz.doInfinityTz
*/
@FlowPreview
fun KronSchedulerTz.asTzFlow(): Flow<DateTimeTz> = channelFlow {
doInfinity {
send(DateTime.nowLocal())
fun KronScheduler.asTzFlow(): Flow<DateTimeTz> = channelFlow {
doInfinityTz {
send(it)
}
}
@@ -25,29 +25,15 @@ fun KronSchedulerTz.asTzFlow(): Flow<DateTimeTz> = channelFlow {
* This method is a map for [asTzFlow] and will works the same but return flow with [DateTime]s
*
* @see channelFlow
* @see KronScheduler.doWhile
* @see KronScheduler.doInfinityLocal
*/
@FlowPreview
fun KronScheduler.asFlow(): Flow<DateTime> = channelFlow {
doInfinity {
send(DateTime.now())
doInfinityLocal {
send(it)
}
}
/**
* This [Flow] will trigger emitting each near time which will be returned from [this] [KronScheduler] with attention to
* time zones
*
* @see channelFlow
* @see KronScheduler.asFlow
* @see KronSchedulerTz.asTzFlow
*/
@FlowPreview
fun KronScheduler.asTzFlow(): Flow<DateTimeTz> = when (this) {
is KronSchedulerTz -> asTzFlow()
else -> asFlow().map { it.local }
}
@Deprecated(
"It is not recommended to use this class in future. This functionality will be removed soon",
ReplaceWith("asFlow", "dev.inmo.krontab.utils.asFlow")