Skip to content

Commit

Permalink
#107 fix crash on iOS with fun interface
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex009 committed Mar 24, 2021
1 parent a7f5b30 commit 5ae2ac6
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

package dev.icerock.moko.mvvm.livedata

fun interface Closeable {
interface Closeable {
fun close()

operator fun plus(other: Closeable): Closeable {
Expand All @@ -13,4 +13,14 @@ fun interface Closeable {
other.close()
}
}

companion object {
operator fun invoke(block: () -> Unit): Closeable {
return object: Closeable {
override fun close() {
block()
}
}
}
}
}

0 comments on commit 5ae2ac6

Please sign in to comment.