Skip to content

Commit

Permalink
fix: $update operator containg updated objects
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Feb 18, 2024
1 parent e9f7e50 commit 8ed0c30
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -613,6 +613,7 @@ function openCursor(objectStore, range, direction, data, newData, isFilter, inde
let update = createUpdate((cursor && cursor.value) ? cursor.value : {}, data[type][i], globalOperators)
if (update) {
await put(objectStore, update)
data[type][i].$update = update
}
}
data[type][i] = { ...reference, ...data[type][i] }
Expand All @@ -638,6 +639,7 @@ function openCursor(objectStore, range, direction, data, newData, isFilter, inde
if (update)
await cursorUpdate(cursor, update)
result = data[type][i]
result.$update = update
// result = cursor.update(update)
hasUpdated = true
// set dotnotation for keys with $operators for items that end in [] to be used by socket.id
Expand Down

0 comments on commit 8ed0c30

Please sign in to comment.