Skip to content

Commit

Permalink
Remove entity disposal during reset
Browse files Browse the repository at this point in the history
  • Loading branch information
notthatjen committed Jun 9, 2024
1 parent 0ead842 commit e930d41
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ const MiniJS = (() => {
},
reset: async () => {
await mini.reset()
},
}
}
})()

Expand Down
7 changes: 3 additions & 4 deletions lib/state.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export class State {
}

setProxyWindow() {
this.window = this.create(window)
this.window ||= this.create(window)
}

getEntityByElement(el, entities = Array.from(this.entities.values())) {
Expand Down Expand Up @@ -299,10 +299,9 @@ export class State {
}

dispose() {
Array.from(this.entities.values()).forEach((entity) => entity.dispose())
this.shouldUpdate = false
this.entities.clear()
this.variables.clear()
this.entityVariables.clear()
this.shouldUpdate = false
this.variables.clear()
}
}

0 comments on commit e930d41

Please sign in to comment.