- fix: updated from Store to Component: using Watch with 'immediate' parameters! @Watch('todos_changed', { immediate: true, deep: true })
- fix immediate only if you need to change something very quickly... otherwise it not need. - fix: modified become FALSE when is sent, otherwise infinite loop...
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import indexdb from './indexdb'
|
||||
|
||||
export default async (context, cmd, table, data, id = '') => {
|
||||
console.log('globalroutines', cmd, table, data, id)
|
||||
export default async (context, cmd, table, data = null, id = '') => {
|
||||
const descr = data !== null ? data.descr : ''
|
||||
console.log('globalroutines', cmd, table, descr, id)
|
||||
return await indexdb(context, cmd, table, data, id)
|
||||
}
|
||||
|
||||
@@ -31,18 +31,12 @@ async function readfromIndexDbToStateTodos(context, table) {
|
||||
|
||||
return await storage.getalldata(table)
|
||||
.then(records => {
|
||||
console.log('PRIMA:', Todos.state.todos)
|
||||
console.log('&&&&&&& readfromIndexDbToStateTodos OK: Num RECORD: ', records.length)
|
||||
console.log(' records:', records)
|
||||
if (table === 'todos') {
|
||||
Todos.state.todos = [...records]
|
||||
console.log('DOPO:', Todos.state.todos)
|
||||
Todos.state.todos_changed++
|
||||
console.log('Todos.state.todos_changed:', Todos.state.todos_changed)
|
||||
|
||||
setTimeout(testfunc2, 3000)
|
||||
|
||||
|
||||
// setTimeout(testfunc2, 3000)
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.log('err: ', error)
|
||||
|
||||
Reference in New Issue
Block a user