File tree Expand file tree Collapse file tree 5 files changed +9
-2
lines changed
firebase-common/src/jsMain/kotlin/dev/teamhub/firebase
androidMain/kotlin/dev/teamhub/firebase/database
commonMain/kotlin/dev/teamhub/firebase/database
jsMain/kotlin/dev/teamhub/firebase/database
firebase-firestore/src/jsMain/kotlin/dev/teamhub/firebase/firestore Expand file tree Collapse file tree 5 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ external object firebase {
112
112
113
113
open class Reference : Query {
114
114
val key: String?
115
+ fun child (path : String ): Reference
115
116
fun remove (): Promise <Unit >
116
117
fun onDisconnect (): OnDisconnect
117
118
fun update (value : Any? ): Promise <Unit >
Original file line number Diff line number Diff line change @@ -129,6 +129,9 @@ actual class DatabaseReference internal constructor(
129
129
): Query(android, persistenceEnabled) {
130
130
131
131
actual val key get() = android.key
132
+
133
+ actual fun child (path : String ) = DatabaseReference (android.child(path), persistenceEnabled)
134
+
132
135
actual fun push () = DatabaseReference (android.push(), persistenceEnabled)
133
136
actual fun onDisconnect () = OnDisconnect (android.onDisconnect(), persistenceEnabled)
134
137
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ expect open class Query {
51
51
expect class DatabaseReference : Query {
52
52
val key: String?
53
53
fun push (): DatabaseReference
54
+ fun child (path : String ): DatabaseReference
54
55
fun onDisconnect (): OnDisconnect
55
56
@ImplicitReflectionSerializer
56
57
suspend fun setValue (value : Any? )
Original file line number Diff line number Diff line change @@ -80,6 +80,8 @@ actual class DatabaseReference internal constructor(override val js: firebase.da
80
80
81
81
actual val key get() = rethrow { js.key }
82
82
actual fun push () = rethrow { DatabaseReference (js.push()) }
83
+ actual fun child (path : String ) = rethrow { DatabaseReference (js.child(path)) }
84
+
83
85
actual fun onDisconnect () = rethrow { OnDisconnect (js.onDisconnect()) }
84
86
85
87
actual suspend fun updateChildren (update : Map <String , Any ?>) =
Original file line number Diff line number Diff line change @@ -172,10 +172,10 @@ actual class Transaction(val js: firebase.firestore.Transaction) {
172
172
actual class DocumentReference (val js : firebase.firestore.DocumentReference ) {
173
173
174
174
actual val id: String
175
- get() = rethrow { js.id }
175
+ get() = rethrow { js.id }
176
176
177
177
actual val path: String
178
- get() = rethrow { js.path }
178
+ get() = rethrow { js.path }
179
179
180
180
actual suspend inline fun <reified T : Any > set (data : T , merge : Boolean ) =
181
181
rethrow { js.set(encode(data)!! , json(" merge" to merge)).await() }
You can’t perform that action at this time.
0 commit comments