Skip to content

Commit 6375334

Browse files
authored
Update README.md
1 parent c995284 commit 6375334

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

README.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,26 +5,37 @@
55
🔓 <a href="https://teamhub.typeform.com/to/uSS8cv">Request Early Access</a>
66
<h4></h4>
77

8-
The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It's API is similar to the [Firebase Android SDK Kotlin Extensions](https://firebase.github.io/firebase-android-sdk/reference/kotlin/firebase-ktx/) but it also supports multiplatform projects, enabling you to use Firebase directly from your common source targeting *iOS*, *Android* or *JS*.
8+
The Firebase Kotlin SDK is a Kotlin-first SDK for Firebase. It's API is similar to the [Firebase Android SDK Kotlin Extensions](https://firebase.github.io/firebase-android-sdk/reference/kotlin/firebase-ktx/) but also supports multiplatform projects, enabling you to use Firebase directly from your common source targeting *iOS*, *Android* or *JS*.
99

1010
## Kotlin-first design
1111

12-
Unlike the Kotlin Extensions for the Firebase Android SDK this project does not extend a Java based SDK so we get to use the full power of Kotlin.
12+
Unlike the Kotlin Extensions for the Firebase Android SDK this project does not extend a Java based SDK so we get the full power of Kotlin including coroutines and serialization!
1313

1414
<h4><a href="https://kotlinlang.org/docs/tutorials/coroutines/async-programming.html#coroutines">Suspending functions</a></h4>
1515

1616
Asynchronous operations that return a single or no value are represented by suspending functions in the SDK instead of callbacks, listeners or OS specific types such as [Task](https://developer.android.com/reference/com/google/android/play/core/tasks/Task), for example:
1717

18-
`suspend fun signInWithCustomToken(token: String): AuthResult`
18+
```kotlin
19+
suspend fun signInWithCustomToken(token: String): AuthResult
20+
```
1921

20-
Note in the case of functions which do not return a value the use of suspending functions means the default behavior when calling these functions is to wait for them to complete
22+
It is important to remember that unlike a callback based API, wating for suspending functions to complete is implicit and so if you don't want to wait for the result you can `launch` a new coroutine:
23+
24+
```kotlin
25+
//TODO don't use GlobalScope
26+
GlobalScope.launch {
27+
Firebase.auth.signOut()
28+
}
29+
```
2130

2231
<h4><a href="https://kotlinlang.org/docs/reference/coroutines/flow.html">Flows</a></h4>
2332

24-
Asynchronous streams of values are represented by Flows in the SDK instead of repeatedly Invoked callbacks or listeners, for example:
33+
Asynchronous streams of values are represented by Flows in the SDK instead of repeatedly invoked callbacks or listeners, for example:
2534

2635
`val snapshots: Flow<DocumentSnapshot>`
2736

37+
38+
2839
<h4><a href="https://github.com/Kotlin/kotlinx.serialization">Serialization</a></h4>
2940

3041
<h4><a href="https://kotlinlang.org/docs/reference/functions.html#named-arguments">Named arguments</a></h4>

0 commit comments

Comments
 (0)