Skip to content

Commit 1cc9604

Browse files
authored
Update README.md
1 parent 48c6ad5 commit 1cc9604

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
@@ -26,7 +26,7 @@ Is the Firebase library or API you need missing? [Create an issue](https://githu
2626

2727
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!
2828

29-
<h4><a href="https://kotlinlang.org/docs/tutorials/coroutines/async-programming.html#coroutines">Suspending functions</a></h4>
29+
<h3><a href="https://kotlinlang.org/docs/tutorials/coroutines/async-programming.html#coroutines">Suspending functions</a></h3>
3030

3131
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:
3232

@@ -43,7 +43,7 @@ GlobalScope.launch {
4343
}
4444
```
4545

46-
<h4><a href="https://kotlinlang.org/docs/reference/coroutines/flow.html">Flows</a></h4>
46+
<h3><a href="https://kotlinlang.org/docs/reference/coroutines/flow.html">Flows</a></h3>
4747

4848
Asynchronous streams of values are represented by Flows in the SDK instead of repeatedly invoked callbacks or listeners, for example:
4949

@@ -55,7 +55,7 @@ The flows are cold, which means a new listener is added every time a terminal op
5555

5656
The listener is removed once the flow [completes](https://kotlinlang.org/docs/reference/coroutines/flow.html#flow-completion) or is [cancelled](https://kotlinlang.org/docs/reference/coroutines/flow.html#flow-cancellation).
5757

58-
<h4><a href="https://github.com/Kotlin/kotlinx.serialization">Serialization</a></h4>
58+
<h3><a href="https://github.com/Kotlin/kotlinx.serialization">Serialization</a></h3>
5959

6060
The official Firebase SDKs use different platform-specific ways to support writing data with and without custom classes in [Cloud Firestore](https://firebase.google.com/docs/firestore/manage-data/add-data#custom_objects), [Realtime Database](https://firebase.google.com/docs/database/android/read-and-write#basic_write) and [Functions](https://firebase.google.com/docs/functions/callable).
6161

@@ -83,6 +83,17 @@ db.collection("cities").document("LA").set(City.serializer(), city)
8383

8484
You can also omit the serializer for classes that does not have generic type arguments, these functions are marked [`@ImplicitReflectionSerializer`](https://github.com/Kotlin/kotlinx.serialization/blob/master/docs/runtime_usage.md#implicit-reflection-serializers) and their usage is discouraged in general because it is implicit and uses reflection (and therefore not working on Kotlin/Native), but may be useful shorthand in some cases.
8585

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

88-
<h3><a href="https://kotlinlang.org/docs/reference/multiplatform.html">Multiplatform</a></h3>
88+
To improve readability functions such as the Cloud Firestore query operators use named arguments:
89+
90+
```kotlin
91+
citiesRef.whereEqualTo("state", "CA")
92+
citiesRef.whereArrayContains("regions", "west_coast")
93+
94+
//...becomes...
95+
citiesRef.where("state", equalTo = "CA")
96+
citiesRef.where("regions", arrayContains = "west_coast")
97+
````
98+
99+
<h2><a href="https://kotlinlang.org/docs/reference/multiplatform.html">Multiplatform</a></h2>

0 commit comments

Comments
 (0)