mirror of
https://github.com/oxen-io/session-android.git
synced 2025-10-10 10:59:56 +00:00
Fix individual group subs
This commit is contained in:
@@ -3,6 +3,7 @@ package org.session.libsignal.utilities
|
||||
|
||||
import nl.komponents.kovenant.Promise
|
||||
import nl.komponents.kovenant.deferred
|
||||
import nl.komponents.kovenant.functional.map
|
||||
import nl.komponents.kovenant.task
|
||||
import java.util.concurrent.TimeoutException
|
||||
|
||||
@@ -58,4 +59,11 @@ fun <V> Promise<V, Exception>.timeout(millis: Long): Promise<V, Exception> {
|
||||
if (!deferred.promise.isDone()) { deferred.reject(it) }
|
||||
}
|
||||
return deferred.promise
|
||||
}
|
||||
}
|
||||
|
||||
infix fun <V, E: Exception> Promise<V, E>.sideEffect(
|
||||
callback: (value: V) -> Unit
|
||||
) = map {
|
||||
callback(it)
|
||||
it
|
||||
}
|
||||
|
Reference in New Issue
Block a user