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
By default, VueFire **will not reset** the property, you can customize this behavior by providing a second argument of options to the `firestoreUnbind`/`rtdbUnbind`
211
+
By default, VueFire **does not reset** a bound property but you can customize this behavior by providing a second argument to the `firestoreUnbind`/`rtdbUnbind`
212
212
213
213
<FirebaseExample>
214
214
215
215
```js
216
-
// default behavior
216
+
// default behavior: leave the property unchanged after unbinding
217
217
this.$databaseUnbind('user')
218
218
// same as
219
219
this.$databaseUnbind('user', false)
220
-
// this.user === { name: 'Eduardo' }
220
+
//Afterwards this.user will retain its value, e.g. { name: 'Eduardo' }
221
221
222
-
// using a boolean value for reset to keep current value
222
+
// if you set the second parameter to `true`, the property will be reset to a standard value
223
+
// for references bound as primitives or objects, this standard value is `null`
223
224
this.$databaseUnbind('user', true)
224
-
// this.user === null
225
+
//Afterwards, this.user === null.
225
226
226
-
// using the function syntax to customize the value
227
+
// for references bound as arrays, this standard value is an empty array
228
+
this.$databaseUnbind('documents', true)
229
+
// this.documents === []
230
+
231
+
// you can specify what value to reset the property to, using a function instead of `true`
0 commit comments