Mutate state with .value directly.
Closed this issue · 1 comments
Plinpod commented
Hello,
I just at started using vuexfire and was wondering if it's possible to map the .value inside the returned firebase object to the state directly. Currently I have an initial state like this
state: {
active: false
}
After I setup vuexfire and bindFirebaseRef it works and gets my active value from firebase and makes the state this
bindFirebaseRef('active', db.ref('state').child('active')
state: {
active: {
.key: "active",
.value: true
}
}
I would like it to make it to map .value directly to the active property in the state like so
state: {
active: true
}
Hope that makes sense. Thanks!
posva commented
This is unfortunately not possible when targetting a child property. If you target directly the state
from your firebase database, you can bind that onto a property and you will have { active: true }