revert part of #14811. it makes no sense to show the initial value, it just makes things inconsistent with deriveds. personally i find it more confusing anyway

pull/16131/head
Rich Harris 3 months ago
parent 7cc7dfa68c
commit dcbb740843

@ -20,7 +20,7 @@ export let tracing_expressions = null;
* @param {TraceEntry} [entry]
*/
function log_entry(signal, entry) {
const value = signal.trace_need_increase ? signal.trace_v : signal.v;
const value = signal.v;
if (value === UNINITIALIZED) {
return;

@ -170,7 +170,6 @@ export function internal_set(source, value) {
if (active_effect !== null) {
source.trace_need_increase = true;
source.trace_v ??= old_value;
}
}

@ -21,7 +21,6 @@ export interface Value<V = unknown> extends Signal {
created?: Error | null;
updated?: Error | null;
trace_need_increase?: boolean;
trace_v?: V;
}
export interface Reaction extends Signal {

@ -454,7 +454,6 @@ export function update_effect(effect) {
if (dep.trace_need_increase) {
dep.wv = increment_write_version();
dep.trace_need_increase = undefined;
dep.trace_v = undefined;
}
}
}

@ -36,14 +36,14 @@ export default test({
{ log: true },
{ log: '$state', highlighted: true },
{ log: 'count', highlighted: false },
{ log: 1 },
{ log: 2 },
{ log: 'effect' },
{ log: '$state', highlighted: false },
{ log: 'checked', highlighted: false },
{ log: true },
{ log: '$state', highlighted: true },
{ log: 'count', highlighted: false },
{ log: 2 },
{ log: 3 },
{ log: 'effect' },
{ log: '$state', highlighted: false },
{ log: 'checked', highlighted: false },

Loading…
Cancel
Save