@ -1308,7 +1308,6 @@ export function derived(init) {
create _computation _signal ( flags | CLEAN , UNINITIALIZED , current _block )
) ;
signal . i = init ;
bind _signal _to _component _context ( signal ) ;
signal . e = default _equals ;
if ( current _consumer !== null ) {
push _reference ( current _consumer , signal ) ;
@ -1335,26 +1334,7 @@ export function derived_safe_equal(init) {
* /
/*#__NO_SIDE_EFFECTS__*/
export function source ( initial _value ) {
const source = create _source _signal ( SOURCE | CLEAN , initial _value ) ;
bind _signal _to _component _context ( source ) ;
return source ;
}
/ * *
* This function binds a signal to the component context , so that we can fire
* beforeUpdate / afterUpdate callbacks at the correct time etc
* @ param { import ( './types.js' ) . Signal } signal
* /
function bind _signal _to _component _context ( signal ) {
if ( current _component _context === null || ! current _component _context . r ) return ;
const signals = current _component _context . d ;
if ( signals ) {
signals . push ( signal ) ;
} else {
current _component _context . d = [ signal ] ;
}
return create _source _signal ( SOURCE | CLEAN , initial _value ) ;
}
/ * *
@ -1366,6 +1346,13 @@ function bind_signal_to_component_context(signal) {
export function mutable _source ( initial _value ) {
const s = source ( initial _value ) ;
s . e = safe _equal ;
// bind the signal to the component context, in case we need to
// track updates to trigger beforeUpdate/afterUpdate callbacks
if ( current _component _context ) {
( current _component _context . d ? ? = [ ] ) . push ( s ) ;
}
return s ;
}
@ -1974,10 +1961,7 @@ function observe_all(context) {
for ( const signal of context . d ) get ( signal ) ;
}
const props = get _descriptors ( context . s ) ;
for ( const descriptor of Object . values ( props ) ) {
if ( descriptor . get ) descriptor . get ( ) ;
}
deep _read ( context . s ) ;
}
/ * *