File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed
androidMain/kotlin/dev/teamhub/firebase/functions
commonMain/kotlin/dev/teamhub/firebase/functions
iosMain/kotlin/dev/teamhub/firebase/functions
jsMain/kotlin/dev/teamhub/firebase/functions Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -31,12 +31,12 @@ actual class FirebaseFunctions internal constructor(val android: com.google.fire
31
31
}
32
32
33
33
actual class HttpsCallableReference internal constructor(val android : com.google.firebase.functions.HttpsCallableReference ) {
34
- actual suspend fun call () = HttpsCallableResult (android.call().await())
34
+ actual suspend operator fun invoke () = HttpsCallableResult (android.call().await())
35
35
36
- actual suspend fun call (data : Any ) =
36
+ actual suspend operator fun invoke (data : Any ) =
37
37
HttpsCallableResult (android.call(encode(data)).await())
38
38
39
- actual suspend fun <T > call (strategy : SerializationStrategy <T >, data : T ) =
39
+ actual suspend operator fun <T > invoke (strategy : SerializationStrategy <T >, data : T ) =
40
40
HttpsCallableResult (android.call(encode(strategy, data)).await())
41
41
}
42
42
Original file line number Diff line number Diff line change @@ -17,9 +17,9 @@ expect class FirebaseFunctions {
17
17
18
18
expect class HttpsCallableReference {
19
19
@ImplicitReflectionSerializer
20
- suspend fun call (data : Any ): HttpsCallableResult
21
- suspend fun <T > call (strategy : SerializationStrategy <T >, data : T ): HttpsCallableResult
22
- suspend fun call (): HttpsCallableResult
20
+ suspend operator fun invoke (data : Any ): HttpsCallableResult
21
+ suspend operator fun <T > invoke (strategy : SerializationStrategy <T >, data : T ): HttpsCallableResult
22
+ suspend operator fun invoke (): HttpsCallableResult
23
23
}
24
24
25
25
expect class HttpsCallableResult {
Original file line number Diff line number Diff line change @@ -33,12 +33,12 @@ actual class FirebaseFunctions internal constructor(val ios: FIRFunctions) {
33
33
}
34
34
35
35
actual class HttpsCallableReference internal constructor(val ios : FIRHTTPSCallable ) {
36
- actual suspend fun call () = HttpsCallableResult (ios.awaitResult { callWithCompletion(it) })
36
+ actual suspend operator fun invoke () = HttpsCallableResult (ios.awaitResult { callWithCompletion(it) })
37
37
38
- actual suspend fun call (data : Any ) =
38
+ actual suspend operator fun invoke (data : Any ) =
39
39
HttpsCallableResult (ios.awaitResult { callWithObject(encode(data), it) })
40
40
41
- actual suspend fun <T > call (strategy : SerializationStrategy <T >, data : T ) =
41
+ actual suspend operator fun <T > invoke (strategy : SerializationStrategy <T >, data : T ) =
42
42
HttpsCallableResult (ios.awaitResult { callWithObject(encode(strategy, data), it) })
43
43
}
44
44
Original file line number Diff line number Diff line change @@ -30,13 +30,13 @@ actual class FirebaseFunctions internal constructor(val js: firebase.functions.F
30
30
@Suppress(" UNCHECKED_CAST" )
31
31
actual class HttpsCallableReference internal constructor(val js : firebase.functions.HttpsCallable ) {
32
32
33
- actual suspend fun call () =
33
+ actual suspend operator fun invoke () =
34
34
rethrow { HttpsCallableResult (js().await()) }
35
35
36
- actual suspend fun call (data : Any ) =
36
+ actual suspend operator fun invoke (data : Any ) =
37
37
rethrow { HttpsCallableResult (js(encode(data)).await()) }
38
38
39
- actual suspend fun <T > call (strategy : SerializationStrategy <T >, data : T ) =
39
+ actual suspend operator fun <T > invoke (strategy : SerializationStrategy <T >, data : T ) =
40
40
rethrow { HttpsCallableResult (js(encode(strategy, data)).await()) }
41
41
}
42
42
You can’t perform that action at this time.
0 commit comments