Skip to content

Commit cd24e51

Browse files
committed
tweak
1 parent 00ba548 commit cd24e51

File tree

1 file changed

+2
-13
lines changed
  • packages/svelte/src/internal/client/reactivity

1 file changed

+2
-13
lines changed

packages/svelte/src/internal/client/reactivity/deriveds.js

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,11 @@ export function async_derived(fn, location) {
130130

131131
prev = promise;
132132

133-
var restore = capture();
134-
135133
var batch = /** @type {Batch} */ (current_batch);
136134
var ran = boundary.ran;
137135

138136
if (should_suspend) {
139-
if (!ran) {
140-
boundary.increment();
141-
} else {
142-
batch.increment();
143-
}
137+
(ran ? batch : boundary).increment();
144138
}
145139

146140
/**
@@ -154,15 +148,10 @@ export function async_derived(fn, location) {
154148
return;
155149
}
156150

157-
restore();
158151
from_async_derived = null;
159152

160153
if (should_suspend) {
161-
if (!ran) {
162-
boundary.decrement();
163-
} else {
164-
batch.decrement();
165-
}
154+
(ran ? batch : boundary).decrement();
166155
}
167156

168157
if (ran) batch.restore();

0 commit comments

Comments
 (0)