We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
orEmpty
1 parent b788dec commit 2046434Copy full SHA for 2046434
core/src/commonMain/kotlin/pro/respawn/apiresult/CollectionResult.kt
@@ -18,6 +18,11 @@ import kotlin.jvm.JvmName
18
*/
19
public inline fun <T> ApiResult<Collection<T>>.orEmpty(): Collection<T> = or(emptyList())
20
21
+/**
22
+ * Returns [emptyList] if [this]'s list is empty
23
+ */
24
+public inline fun <T> ApiResult<List<T>>.orEmpty(): List<T> = or(emptyList())
25
+
26
/**
27
* Returns [emptyList] if [this]'s collection is empty
28
0 commit comments