Skip to content

Commit

Permalink
chore: remove unnecessary try...finally
Browse files Browse the repository at this point in the history
  • Loading branch information
OnlyWick committed Mar 6, 2024
1 parent d7f2afa commit b406a0b
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions packages/core/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -340,17 +340,14 @@ Object.defineProperty(Signal.prototype, "value", {
globalVersion++;

/**@__INLINE__*/ startBatch();
try {
for (
let node = this._targets;
node !== undefined;
node = node._nextTarget
) {
node._target._notify();
}
} finally {
endBatch();
for (
let node = this._targets;
node !== undefined;
node = node._nextTarget
) {
node._target._notify();
}
endBatch();
}
},
});
Expand Down Expand Up @@ -768,12 +765,4 @@ function effect(compute: () => unknown | EffectCleanup): () => void {
return effect._dispose.bind(effect);
}

export {
signal,
computed,
effect,
batch,
Signal,
ReadonlySignal,
untracked,
};
export { signal, computed, effect, batch, Signal, ReadonlySignal, untracked };

0 comments on commit b406a0b

Please sign in to comment.