@ -189,7 +189,8 @@ function create_source_signal(flags, value) {
// value
v:value,
// this is for DEV only
inspect:newSet()
inspect:newSet(),
owners:newSet()
};
}
return{
@ -956,8 +957,10 @@ export function unsubscribe_on_destroy(stores) {
*/
exportfunctionget(signal){
if(DEV){
if(signal.o&¤t_owner_override){
signal.o.add(current_owner_override);
// @ts-expect-error
if(signal.owners&¤t_owner_override){
// @ts-expect-error
signal.owners.add(current_owner_override);
}
// @ts-expect-error
@ -1033,7 +1036,9 @@ export function get(signal) {
exportfunctionset(signal,value){
if(DEV&&'o'insignal){
constcomponent=get_component();
if(component&&!signal.o.has(component)){
// @ts-expect-error
if(component&&!signal.owners.has(component)){
console.warn(
'Mutating a value outside the component that created it is strongly discouraged. Consider passing values to child components with `bind:`, or use callback instead.'
);
@ -1354,9 +1359,12 @@ export function source(initial_value) {