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
{{ message }}
This repository has been archived by the owner on Apr 19, 2019. It is now read-only.
I am pretty sure I am the only one with this issue. I posted on StackOverflow but the system would not let me tag it properly with 'VuexFire'.
Here is my main.js where I declare the main VueJS app and its main components:
export default new Vue({
el: '#app',
// Binds app with Firebase servers as to always have the currentUser
beforeCreate () {
auth()
.onAuthStateChanged(user => {
if (user) {
// save the new user
this.currentUser = user
// get the required references to the Firebase database
const currentUserRef = database().ref(`users/${user.uid}`)
const claimsRef = database().ref(`claims/${user.uid}/`)
// do the actual bindings from firebase to the vuex store
this.$bindAsObject('users.currentUser', currentUserRef)
this.$bindAsArray('claims.items', claimsRef) // <-- Here is the problem apparently
// Make the binding references available on the root module
this.currentUserRef = currentUserRef
this.claimsRef = claimsRef
} else {
auth()
.signInAnonymously()
.catch(this.$handleError)
}
}).bind(this)
},
data: {
claimsRef: null,
currentUserRef: {},
currentUser: null
},
render: h => h(App),
router, // defines the main routing system in the app
store // inject vuex into all components as this.$store
})
Binding as an Object is totally fine (no errors). But binding as an Array throws the following error:
Also, for reference, here is my corresponding Vuex module definition:
import { mutations as vuexMutations } from 'vuexfire'
const state = {
items: null
}
const getters = {
claims: ({ items }) => items
}
// Needed for VuexFire to automutate the bound claims items
const mutations = vuexMutations
export default {
namespaced: true,
mutations,
state
}
The text was updated successfully, but these errors were encountered:
Hello, yeah, v1 didn't support strict mode. See #30 for more. There's a PR at #34 but it wasn't working yet. It should be easy to do but now that there's the v2 I won't do it myself, contributions are welcome to the v1 branch though 🙂
Hi all,
I am pretty sure I am the only one with this issue. I posted on StackOverflow but the system would not let me tag it properly with 'VuexFire'.
Here is my main.js where I declare the main VueJS app and its main components:
Binding as an Object is totally fine (no errors). But binding as an Array throws the following error:
Also, for reference, here is my corresponding Vuex module definition:
The text was updated successfully, but these errors were encountered: