mirror of
https://github.com/InsanusMokrassar/MicroUtils.git
synced 2024-11-26 03:58:45 +00:00
add inline functions in DoWithFirstBuilder
This commit is contained in:
parent
d06bb265e5
commit
012c7e9bdf
@ -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()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user