I'm using Vue/Vuex to generate components from an array with this structure (retrieved from SQLite using better-sqlite3).
let table=[
{
id:1,
column_1:'data',
column_2:'data',
column_3:{'1':'data','2':'data','3':'data'}
},
{
id:2,
column_1:'data',
column_2:'data',
column_3:{'1':'data','2':'data','3':'data'}
},
...
]
There are cases where the data of multiple rows need to be updated at once. Since I need to pass data back and forth between SQLite and Vue, I'm wondering whether it'll be simpler and harmless to update the data with sql and then replace the entire javascript array with the updated data, including the unmodified rows. Otherwise I imagine I'll have to use .find()
to go through and change the specific items. So my question is whether replacing the whole array is a Bad Idea as far as reactivity goes, or whether Vue can smart update accordingly.