Skip to content

Commit

Permalink
Merge pull request #4 from aSoft-Ltd/dev-master
Browse files Browse the repository at this point in the history
Dev master
  • Loading branch information
andylamax authored Dec 17, 2020
2 parents 2f0eb52 + e15ee40 commit 1fc99bd
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# 0.0.2 : 2020.12.17
- added `suspend fun Later<T>.await():T`

# 0.0.1 : 2020.12.17
## Availability
- Published to maven central
Expand Down
Binary file modified buildSrc/.gradle/6.7.1/executionHistory/executionHistory.bin
Binary file not shown.
Binary file modified buildSrc/.gradle/6.7.1/executionHistory/executionHistory.lock
Binary file not shown.
Binary file modified buildSrc/.gradle/buildOutputCleanup/buildOutputCleanup.lock
Binary file not shown.
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object vers {
object asoft {
val test = "1.0.1"
val builders = "1.1.1"
val later = "0.0.1"
val later = "0.0.2"
}

object kotlinx {
Expand Down
1 change: 1 addition & 0 deletions src/commonMain/kotlin/tz/co/asoft/Later.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ expect class Later<T>(scope: CoroutineScope = LaterScope, deferred: Deferred<T>)
internal val scope: CoroutineScope

@JvmSynthetic
@PublishedApi
internal val deferred: Deferred<T>

fun wait(): T
Expand Down
4 changes: 3 additions & 1 deletion src/commonMain/kotlin/tz/co/asoft/Later.ktx.kt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,6 @@ fun <T> later(scope: CoroutineScope = LaterScope, builder: suspend () -> T) = La
fun <T> CoroutineScope.later(builder: suspend () -> T) = Later(
scope = this,
deferred = async { builder() }
)
)

suspend inline fun <T> Later<T>.await() = deferred.await()

0 comments on commit 1fc99bd

Please # to comment.