Closed ghost closed 6 years ago
In the doc , you state that we should add the following action in the store/root.js
setDetailsRef: firebaseAction(({ bindFirebaseRef, unbindFirebaseRef }, ref) => { bindFirebaseRef('details', ref) unbindFirebaseRef('details') }),
to be called with
`this.$store.dispatch('setUserDetailsRef', db.ref('details')`
I do not understand why there is a binding followed by an unbind , can you explain it ?
should not it be=
setDetailsRef: firebaseAction(({ bindFirebaseRef, unbindFirebaseRef }, ref) => { if (ref === null) { unbindFirebaseRef('details') } else { bindFirebaseRef('details', ref) } }),
thanks
Hello, it is just for the sake of the example. As the comment says: it is possible to unbind a bound key at any time I'll change it to another ref so it's less confusing 🙂
In the doc , you state that we should add the following action in the store/root.js
setDetailsRef: firebaseAction(({ bindFirebaseRef, unbindFirebaseRef }, ref) => { bindFirebaseRef('details', ref) unbindFirebaseRef('details') }),
to be called with
I do not understand why there is a binding followed by an unbind , can you explain it ?
should not it be=
setDetailsRef: firebaseAction(({ bindFirebaseRef, unbindFirebaseRef }, ref) => { if (ref === null) { unbindFirebaseRef('details') } else { bindFirebaseRef('details', ref) } }),
thanks