You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `$bind` method is now called `$firestoreBind` to avoid conflicts with other libraries. In the same way, `$unbind` is now called `$firestoreUnbind`.
90
90
91
-
The `$rtdbBind` and `$rtdbUnbind` methods are unchanged.
91
+
### Rename `$rtdbBind` to `$databaseBind`
92
+
93
+
The `$rtdbBind` method is now called `$databaseBind` to have a consistent naming that aligns with the Firebase SDK. In the same way, `$rtdbUnbind` is now called `$databaseUnbind`.
94
+
95
+
Note that for compatibility reasons, the `$rtdbBind` and `$rtdbUnbind` methods are still available but marked as deprecated.
Copy file name to clipboardExpand all lines: docs/guide/options-api-realtime-data.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ This pages assumes you have read the [Realtime Data](./realtime-data.md) page an
7
7
There are two ways of using Realtime Data with VueFire:
8
8
9
9
- Declarative binding with the `firebase`/`firestore` option
10
-
- Programmatic binding with the injected methods `$rtdbBind`/`$firestoreBind`
10
+
- Programmatic binding with the injected methods `$databaseBind`/`$firestoreBind`
11
11
12
12
Once you _bind_, VueFire will keep the local version synchronized with the remote Database. However, this synchronization **is only one-way**. Do not modify the local variable (e.g. doing `this.user.name = 'John'`), because (a) it will not change the remote Database and (b) it can be overwritten at any time by VueFire. To [write changes to the Database](./writing-data.md), use the Firebase JS SDK. In other words, **treat the local variable as read-only**.
13
13
@@ -76,7 +76,7 @@ You must declare properties with their initial values in `data`. **For the RTDB,
76
76
77
77
## Programmatic binding
78
78
79
-
If you need to change the bound reference while the application is running, e.g. to display a different user profile, or different product detail page, _Declarative binding_ isn't enough. This can be achieved through the `$rtdbBind`/`$firestoreBind` methods:
79
+
If you need to change the bound reference while the application is running, e.g. to display a different user profile, or different product detail page, _Declarative binding_ isn't enough. This can be achieved through the `$databaseBind`/`$firestoreBind` methods:
80
80
81
81
<FirebaseExample>
82
82
@@ -97,7 +97,7 @@ export default {
97
97
// call it upon creation too
98
98
immediate:true,
99
99
handler(id) {
100
-
this.$rtdbBind('user', dbRef(users, id))
100
+
this.$databaseBind('user', dbRef(users, id))
101
101
},
102
102
},
103
103
},
@@ -133,21 +133,21 @@ export default {
133
133
With the approach above, `user` will always be bound to the user defined by the prop `id`
134
134
135
135
:::tip
136
-
No need to call `$rtdbUnbind`/`$firestoreUnbind` as `$rtdbBind`/`$firestoreBind` will automatically unbind any existing binding on the provided key. Upon component removal, all bindings are removed as well, so no need to use `$rtdbUnbind`/`$firestoreUnbind` in `unmounted` hooks.
136
+
No need to call `$databaseUnbind`/`$firestoreUnbind` as `$databaseBind`/`$firestoreBind` will automatically unbind any existing binding on the provided key. Upon component removal, all bindings are removed as well, so no need to use `$databaseUnbind`/`$firestoreUnbind` in `unmounted` hooks.
137
137
:::
138
138
139
139
If you need to wait for a binding to be ready before doing something, you can _await_ the returned Promise:
0 commit comments