Skip to content

Commit 35ba3e9

Browse files
committed
Added js functions emulator.
1 parent aea1e36 commit 35ba3e9

File tree

2 files changed

+2
-1
lines changed
  • firebase-common/src/jsMain/kotlin/dev/gitlive/firebase
  • firebase-functions/src/jsMain/kotlin/dev/gitlive/firebase/functions

2 files changed

+2
-1
lines changed

firebase-common/src/jsMain/kotlin/dev/gitlive/firebase/externals.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ external object firebase {
9292
object functions {
9393
class Functions {
9494
fun httpsCallable(name: String, options: Json?): HttpsCallable
95+
fun useFunctionsEmulator(origin: String)
9596
}
9697
interface HttpsCallableResult {
9798
val data: Any?

firebase-functions/src/jsMain/kotlin/dev/gitlive/firebase/functions/functions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ actual class FirebaseFunctions internal constructor(val js: firebase.functions.F
2626
actual fun httpsCallable(name: String, timeout: Long?) =
2727
rethrow { HttpsCallableReference(js.httpsCallable(name, timeout?.let { json("timeout" to timeout.toDouble()) })) }
2828

29-
actual fun useFunctionsEmulator(origin: String): Unit = throw NotImplementedError()
29+
actual fun useFunctionsEmulator(origin: String) = js.useFunctionsEmulator(origin)
3030
}
3131

3232
@Suppress("UNCHECKED_CAST")

0 commit comments

Comments
 (0)