Skip to content

Commit

Permalink
avoid tracking list cleanup when deref() during watch(); [email protected]
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeyraspopov committed Sep 16, 2024
1 parent fb1ee52 commit 7a36a36
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion inertial.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ export function ObservableScope(schedule = immediate) {
}

function deref(...signals) {
let temp = tracking;
tracking = {
add(node) {
if (node.flag & DISPOSER) node.dispose();
Expand All @@ -152,7 +153,7 @@ export function ObservableScope(schedule = immediate) {

for (let signal of signals) signal();

tracking = null;
tracking = temp;
}

function dispose() {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "inertial",
"version": "0.4.0",
"version": "0.4.1",
"type": "module",
"description": "A tiny library for integrating reactive signals anywhere.",
"author": "Oleksii Raspopov",
Expand Down

0 comments on commit 7a36a36

Please sign in to comment.