I'm Dev RoR and I'm in my early studies with VueJS. To do so, I started creating an TodoList with Firebase for data persistence and a problem occurred to me.
I created a function to return FireBase data.
So, when there is a change or inclusion of some data in the database, Firebase returns me all the data that is presented through this Vue instance.
However, when making the first call of the function listTasks()
, in line 4 in the link above, it returns the data to me correctly. But, when there is the change, the vector is not assembled again, but rather concatenated with the new values, ie, I have duplicate data.
How would you do that, whenever there was new data or change, Vue did not concatenate the vector?
I think it's something of the Vue through all the tests I've done so far. But that's just an annoyance initially.