mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2025-09-04 23:59:29 +00:00
add inline functions in DoWithFirstBuilder
This commit is contained in:
@@ -16,6 +16,8 @@ class DoWithFirstBuilder<T>(
|
|||||||
operator fun plus(block: suspend CoroutineScope.() -> T) {
|
operator fun plus(block: suspend CoroutineScope.() -> T) {
|
||||||
deferreds.add(scope.async(start = CoroutineStart.LAZY, block = block))
|
deferreds.add(scope.async(start = CoroutineStart.LAZY, block = block))
|
||||||
}
|
}
|
||||||
|
inline fun add(noinline block: suspend CoroutineScope.() -> T) = plus(block)
|
||||||
|
inline fun include(noinline block: suspend CoroutineScope.() -> T) = plus(block)
|
||||||
|
|
||||||
fun build() = deferreds.toList()
|
fun build() = deferreds.toList()
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user