Seeking guidance on integrating existing ES6 classes with Vue Js.
I currently have a class where a variable is being updated by an observable function.
class A {
public a: string;
someobservable.subscribe((a) =>{
this.a = a;
})
}
Within Vue.js, I have instantiated an object of this class.
Here's a sample of how the property is utilized:
created: {
objA = new A();
}
methods: {
getA() {
if(this.objA !== undefined){
return objA.a;
}
}
}
In the Vue template:
<div>{{getA()}}</div>
However, there seems to be a synchronization issue between the template value and the class variable.
Are there alternative methods for ensuring real-time updates in the Vue template when using properties?