@@ -10,14 +10,14 @@ import {
1010import { get_descriptor , is_function } from '../../shared/utils.js' ;
1111import { mutable_source , set , source , update } from './sources.js' ;
1212import { derived , derived_safe_equal } from './deriveds.js' ;
13- import { get , captured_signals , untrack } from '../runtime.js' ;
13+ import { get , captured_signals , untrack , active_effect } from '../runtime.js' ;
1414import { safe_equals } from './equality.js' ;
1515import * as e from '../errors.js' ;
1616import { LEGACY_DERIVED_PROP , LEGACY_PROPS , STATE_SYMBOL } from '#client/constants' ;
1717import { proxy } from '../proxy.js' ;
1818import { capture_store_binding } from './store.js' ;
1919import { legacy_mode_flag } from '../../flags/index.js' ;
20- import { teardown } from './effects .js' ;
20+ import { component_context } from '../context .js' ;
2121
2222/**
2323 * @param {((value?: number) => number) } fn
@@ -240,8 +240,23 @@ const spread_props_handler = {
240240 * @returns {any }
241241 */
242242export function props ( ...props ) {
243- let destroyed = false ;
244- teardown ( ( ) => ( destroyed = true ) ) ;
243+ let paused = false ;
244+ const context = component_context ;
245+ if ( active_effect ) {
246+ ( active_effect . transitions ??= [ ] ) . push ( {
247+ is_global : true ,
248+ in ( ) {
249+ paused = false ;
250+ } ,
251+ out ( callback ) {
252+ paused = true ;
253+ callback ?. ( ) ;
254+ } ,
255+ stop ( ) {
256+ paused = true ;
257+ }
258+ } ) ;
259+ }
245260 return new Proxy (
246261 {
247262 props,
@@ -254,7 +269,7 @@ export function props(...props) {
254269 return oldProps ;
255270 } ) ,
256271 get destroyed ( ) {
257- return destroyed ;
272+ return ( context ?. d ?? false ) || paused ;
258273 }
259274 } ,
260275 spread_props_handler
0 commit comments