I am using the latest version of Vue.js and I need to use a global object for sharing state in Single Page Vue components. What I'm trying to do is storing the state from a websocket connection in a global object so I can perform actions in Vue.
The problem is that the object is always undefined in Vue.js, but I can clearly see in the browser that the object is populated and have the correct data.
It works using Obj.$set()
and adding every single property, but I don't want to do that since I don't know all properties beforehand.