Skip to content

Commit

Permalink
fix: live-array delete sync should not clear the set on length match (#…
Browse files Browse the repository at this point in the history
…8927)

* fix: add test for unloadAll not fully cleaning up

* fix

* fix lint
  • Loading branch information
runspired committed Sep 28, 2023
1 parent 9ec3d59 commit 031b770
Show file tree
Hide file tree
Showing 2 changed files with 396 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -405,13 +405,13 @@ function sync(
} else {
if (arraySet.has(key)) {
removes.push(key);
arraySet.delete(key);
}
}
});
if (removes.length) {
if (removes.length === state.length) {
state.length = 0;
arraySet.clear();
// changing the reference breaks the Proxy
// state = array[SOURCE] = [];
} else {
Expand Down
Loading

0 comments on commit 031b770

Please sign in to comment.