99} from '../../../constants.js' ;
1010import { get_descriptor , is_function } from '../../shared/utils.js' ;
1111import { mutable_source , set , source , update } from './sources.js' ;
12- import { derived , derived_safe_equal } from './deriveds.js' ;
13- import { get , captured_signals , untrack , active_effect } from '../runtime.js' ;
12+ import { derived , derived_safe_equal , get_derived_parent_effect } from './deriveds.js' ;
13+ import { active_effect , captured_signals , get , untrack } from '../runtime.js' ;
1414import { safe_equals } from './equality.js' ;
1515import * as e from '../errors.js' ;
1616import {
@@ -23,7 +23,6 @@ import {
2323import { proxy } from '../proxy.js' ;
2424import { capture_store_binding } from './store.js' ;
2525import { legacy_mode_flag } from '../../flags/index.js' ;
26- import { component_context } from '../context.js' ;
2726
2827/**
2928 * @param {((value?: number) => number) } fn
@@ -270,7 +269,9 @@ export function props(...props) {
270269 * @param {Derived } derived
271270 */
272271function is_paused_or_destroyed ( derived ) {
273- return ( derived . f & ( DESTROYED | INERT ) ) !== 0 ;
272+ const parent = get_derived_parent_effect ( derived ) ;
273+ if ( ! parent ) return false ;
274+ return ( parent . f & ( DESTROYED | INERT ) ) !== 0 ;
274275}
275276
276277/**
@@ -449,7 +450,7 @@ export function prop(props, key, flags, fallback) {
449450 }
450451
451452 if ( is_paused_or_destroyed ( current_value ) ) {
452- return value ;
453+ return current_value . v ;
453454 }
454455
455456 return get ( current_value ) ;
0 commit comments