@@ -28,15 +28,17 @@ let outros;
28
28
29
29
export function group_outros ( ) {
30
30
outros = {
31
- remaining : 0 ,
32
- callbacks : [ ]
31
+ r : 0 , // remaining outros
32
+ c : [ ] , // callbacks
33
+ p : outros // parent group
33
34
} ;
34
35
}
35
36
36
37
export function check_outros ( ) {
37
- if ( ! outros . remaining ) {
38
- run_all ( outros . callbacks ) ;
38
+ if ( ! outros . r ) {
39
+ run_all ( outros . c ) ;
39
40
}
41
+ outros = outros . p ;
40
42
}
41
43
42
44
export function transition_in ( block , local ?: 0 | 1 ) {
@@ -51,7 +53,7 @@ export function transition_out(block, local: 0 | 1, detach: 0 | 1, callback) {
51
53
if ( outroing . has ( block ) ) return ;
52
54
outroing . add ( block ) ;
53
55
54
- outros . callbacks . push ( ( ) => {
56
+ outros . c . push ( ( ) => {
55
57
outroing . delete ( block ) ;
56
58
if ( callback ) {
57
59
if ( detach ) block . d ( 1 ) ;
@@ -153,7 +155,7 @@ export function create_out_transition(node: Element & ElementCSSInlineStyle, fn:
153
155
154
156
const group = outros ;
155
157
156
- group . remaining += 1 ;
158
+ group . r += 1 ;
157
159
158
160
function go ( ) {
159
161
const {
@@ -178,10 +180,10 @@ export function create_out_transition(node: Element & ElementCSSInlineStyle, fn:
178
180
179
181
dispatch ( node , false , 'end' ) ;
180
182
181
- if ( ! -- group . remaining ) {
183
+ if ( ! -- group . r ) {
182
184
// this will result in `end()` being called,
183
185
// so we don't need to clean up here
184
- run_all ( group . callbacks ) ;
186
+ run_all ( group . c ) ;
185
187
}
186
188
187
189
return false ;
@@ -266,7 +268,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
266
268
if ( ! b ) {
267
269
// @ts -ignore todo: improve typings
268
270
program . group = outros ;
269
- outros . remaining += 1 ;
271
+ outros . r += 1 ;
270
272
}
271
273
272
274
if ( running_program ) {
@@ -309,7 +311,7 @@ export function create_bidirectional_transition(node: Element & ElementCSSInline
309
311
clear_animation ( ) ;
310
312
} else {
311
313
// outro — needs to be coordinated
312
- if ( ! -- running_program . group . remaining ) run_all ( running_program . group . callbacks ) ;
314
+ if ( ! -- running_program . group . r ) run_all ( running_program . group . c ) ;
313
315
}
314
316
}
315
317
0 commit comments