|
|
|
|
@ -47,7 +47,7 @@ import { set_signal_status, update_derived_status } from './status.js';
|
|
|
|
|
/** @type {Set<Effect>} */
|
|
|
|
|
export let eager_effects = new Set();
|
|
|
|
|
|
|
|
|
|
/** @type {Map<Source, any>} */
|
|
|
|
|
/** @type {Map<Value, any>} */
|
|
|
|
|
export const old_values = new Map();
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -71,14 +71,15 @@ export function set_eager_effects_deferred() {
|
|
|
|
|
*/
|
|
|
|
|
// TODO rename this to `state` throughout the codebase
|
|
|
|
|
export function source(v, stack) {
|
|
|
|
|
/** @type {Value} */
|
|
|
|
|
/** @type {Source} */
|
|
|
|
|
var signal = {
|
|
|
|
|
f: 0, // TODO ideally we could skip this altogether, but it causes type errors
|
|
|
|
|
f: 0,
|
|
|
|
|
v,
|
|
|
|
|
reactions: null,
|
|
|
|
|
equals,
|
|
|
|
|
rv: 0,
|
|
|
|
|
wv: 0
|
|
|
|
|
wv: 0,
|
|
|
|
|
e: null
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (DEV && tracing_mode_flag) {
|
|
|
|
|
@ -142,7 +143,7 @@ export function mutate(source, value) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {Source<V>} source
|
|
|
|
|
* @param {Value<V>} source
|
|
|
|
|
* @param {V} value
|
|
|
|
|
* @param {boolean} [should_proxy]
|
|
|
|
|
* @returns {V}
|
|
|
|
|
@ -182,7 +183,7 @@ var count_deps = 0;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {Source<V>} source
|
|
|
|
|
* @param {Value<V>} source
|
|
|
|
|
* @param {V} value
|
|
|
|
|
* @param {Effect[] | null} [updated_during_traversal]
|
|
|
|
|
* @returns {V}
|
|
|
|
|
|