File tree Expand file tree Collapse file tree 1 file changed +9
-18
lines changed
packages/svelte/src/internal/client/reactivity Expand file tree Collapse file tree 1 file changed +9
-18
lines changed Original file line number Diff line number Diff line change @@ -13,7 +13,13 @@ import { derived, derived_safe_equal } from './deriveds.js';
1313import { get , captured_signals , untrack , active_effect } from '../runtime.js' ;
1414import { safe_equals } from './equality.js' ;
1515import * as e from '../errors.js' ;
16- import { LEGACY_DERIVED_PROP , LEGACY_PROPS , STATE_SYMBOL } from '#client/constants' ;
16+ import {
17+ DESTROYED ,
18+ INERT ,
19+ LEGACY_DERIVED_PROP ,
20+ LEGACY_PROPS ,
21+ STATE_SYMBOL
22+ } from '#client/constants' ;
1723import { proxy } from '../proxy.js' ;
1824import { capture_store_binding } from './store.js' ;
1925import { legacy_mode_flag } from '../../flags/index.js' ;
@@ -240,22 +246,7 @@ const spread_props_handler = {
240246 * @returns {any }
241247 */
242248export function props ( ...props ) {
243- let destroyed = false ;
244- if ( active_effect ) {
245- ( active_effect . transitions ??= [ ] ) . push ( {
246- is_global : true ,
247- in ( ) {
248- destroyed = false ;
249- } ,
250- out ( callback ) {
251- destroyed = true ;
252- callback ?. ( ) ;
253- } ,
254- stop ( ) {
255- destroyed = true ;
256- }
257- } ) ;
258- }
249+ const effect = active_effect ;
259250 return new Proxy (
260251 {
261252 props,
@@ -268,7 +259,7 @@ export function props(...props) {
268259 return old_props ;
269260 } ) ,
270261 get destroyed ( ) {
271- return destroyed ;
262+ return effect ? ( effect . f & ( DESTROYED | INERT ) ) !== 0 : false ;
272263 }
273264 } ,
274265 spread_props_handler
You can’t perform that action at this time.
0 commit comments