pull/16126/head
Rich Harris 3 months ago
parent 1d6451223a
commit 4e6e8a4590

@ -43,7 +43,7 @@ function log_entry(signal, entry) {
const type = (signal.f & DERIVED) !== 0 ? '$derived' : '$state';
const current_reaction = /** @type {Reaction} */ (active_reaction);
const dirty = signal.wv > current_reaction.wv || current_reaction.wv === 0;
const { trace_name: name } = signal;
const { label: name } = signal;
const style = dirty
? 'color: CornflowerBlue; font-weight: bold'
: 'color: grey; font-weight: normal';
@ -183,10 +183,10 @@ export function get_stack(label) {
/**
* @param {Value} source
* @param {string} name
* @param {string} label
*/
export function tag(source, name) {
source.trace_name = name;
export function tag(source, label) {
source.label = label;
return source;
}

@ -139,7 +139,7 @@ export function set(source, value, should_proxy = false) {
e.state_unsafe_mutation();
}
let new_value = should_proxy ? proxy(value, DEV ? source.trace_name : undefined) : value;
let new_value = should_proxy ? proxy(value, DEV ? source.label : undefined) : value;
return internal_set(source, new_value);
}

@ -21,7 +21,7 @@ export interface Value<V = unknown> extends Signal {
updated?: Error | null;
trace_need_increase?: boolean;
trace_v?: V;
trace_name?: string;
label?: string;
debug?: null | (() => void);
}

Loading…
Cancel
Save