build: complete Phase 2.1B backend sync integration
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -71,6 +71,43 @@ const mockIndexedDB = (() => {
|
||||
setTimeout(() => req.onsuccess?.(), 0)
|
||||
return req
|
||||
},
|
||||
openCursor: () => {
|
||||
const keys = Object.keys(stores[name])
|
||||
let index = 0
|
||||
const req: any = {
|
||||
result: null,
|
||||
onsuccess: null
|
||||
}
|
||||
setTimeout(() => {
|
||||
if (index < keys.length) {
|
||||
req.result = {
|
||||
value: stores[name][keys[index]],
|
||||
delete: () => {
|
||||
delete stores[name][keys[index]]
|
||||
},
|
||||
continue: () => {
|
||||
index++
|
||||
setTimeout(() => {
|
||||
if (index < keys.length) {
|
||||
req.result = {
|
||||
value: stores[name][keys[index]],
|
||||
delete: () => {
|
||||
delete stores[name][keys[index]]
|
||||
},
|
||||
continue: req.result.continue
|
||||
}
|
||||
} else {
|
||||
req.result = null
|
||||
}
|
||||
req.onsuccess?.({ target: req })
|
||||
}, 0)
|
||||
}
|
||||
}
|
||||
}
|
||||
req.onsuccess?.({ target: req })
|
||||
}, 0)
|
||||
return req
|
||||
},
|
||||
index: (indexName: string) => {
|
||||
return {
|
||||
openCursor: (range?: any) => {
|
||||
|
||||
Reference in New Issue
Block a user