@@ -47,7 +47,7 @@ export function startBatch(): void {
47
47
}
48
48
49
49
export function endBatch ( ) : void {
50
- if ( ! -- batchDepth ) {
50
+ if ( ! -- batchDepth && notifyBufferLength ) {
51
51
processEffectNotifications ( )
52
52
}
53
53
}
@@ -180,7 +180,11 @@ export function propagate(current: Link): void {
180
180
181
181
if ( shouldNotify ) {
182
182
if ( 'notify' in sub ) {
183
- notifyBuffer [ notifyBufferLength ++ ] = sub
183
+ if ( ! batchDepth && ! notifyBufferLength && next === undefined ) {
184
+ sub . notify ( )
185
+ } else {
186
+ notifyBuffer [ notifyBufferLength ++ ] = sub
187
+ }
184
188
} else {
185
189
const subSubs = ( sub as Dependency ) . subs
186
190
if ( subSubs !== undefined ) {
@@ -225,7 +229,7 @@ export function propagate(current: Link): void {
225
229
break
226
230
} while ( true )
227
231
228
- if ( ! batchDepth ) {
232
+ if ( ! batchDepth && notifyBufferLength ) {
229
233
processEffectNotifications ( )
230
234
}
231
235
}
@@ -251,22 +255,6 @@ export function endTracking(sub: Subscriber): void {
251
255
sub . flags &= ~ SubscriberFlags . Tracking
252
256
}
253
257
254
- export function processComputedUpdate (
255
- computed : Computed ,
256
- flags : SubscriberFlags ,
257
- ) : void {
258
- if ( flags & SubscriberFlags . Dirty || checkDirty ( computed . deps ! ) ) {
259
- if ( computed . update ( ) ) {
260
- const subs = computed . subs
261
- if ( subs !== undefined ) {
262
- shallowPropagate ( subs )
263
- }
264
- }
265
- } else {
266
- computed . flags = flags & ~ SubscriberFlags . Pending
267
- }
268
- }
269
-
270
258
export function processEffectNotifications ( ) : void {
271
259
while ( notifyIndex < notifyBufferLength ) {
272
260
const effect = notifyBuffer [ notifyIndex ] !
@@ -348,7 +336,7 @@ export function checkDirty(current: Link): boolean {
348
336
} while ( true )
349
337
}
350
338
351
- function shallowPropagate ( link : Link ) : void {
339
+ export function shallowPropagate ( link : Link ) : void {
352
340
do {
353
341
const sub = link . sub
354
342
const subFlags = sub . flags
0 commit comments