Skip to content

Commit

Permalink
Fixed issue with updates not triggering during array operation.
Browse files Browse the repository at this point in the history
  • Loading branch information
michielvandergeest committed Mar 21, 2024
1 parent 96ba450 commit 3106a74
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/lib/codegenerator/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ const generateForLoopCode = function (templateObject, parent) {

const forCounter = counter
ctx.renderCode.push(`
const collection = ${cast(result[2], ':for')}
const collection = ${cast(result[2], ':for')} || []
const keys = []
for(let __index = 0; __index < collection.length; __index++) {
parent = ${parent}
Expand Down
2 changes: 1 addition & 1 deletion src/lib/reactivity/reactive.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const reactiveProxy = (original, _parent = null, _key) => {
// trigger a change on the parent object and the key
// i.e. when pushing a new item to `obj.data`, _parent will equal `obj`
// and _key will equal `data`
trigger(_parent, _key)
resumeTracking()
trigger(_parent, _key)
return result
}
} else {
Expand Down

0 comments on commit 3106a74

Please sign in to comment.