data(){
return {
tables:[]
}
},
mounted(){
this.fetchData()
},
methods:{
fetchData(){
var subscription = web3.eth.subscribe('logs', {
address: '0x123456..',
topics: ['0x12345...']
}, function(error, result){
if (!error)
console.log(result);
})
.on("data", function(log){
// Trying to store log data in this.tables but getting an error: typeError: Invalid attempt to spread non-iterable instance. Non-array objects must have a [Symbol.iterator]() method to be iterable.
this.tables = [...log]
})
}
}
What is an alternative method in Vue JS to successfully store data in this.tables?