|
|
|
|
@ -9,7 +9,7 @@ import {
|
|
|
|
|
object_prototype
|
|
|
|
|
} from './utils.js';
|
|
|
|
|
import { unstate } from './proxy.js';
|
|
|
|
|
import { pre_effect } from './reactivity/computations.js';
|
|
|
|
|
import { pre_effect } from './reactivity/effects.js';
|
|
|
|
|
import {
|
|
|
|
|
EFFECT,
|
|
|
|
|
PRE_EFFECT,
|
|
|
|
|
@ -45,36 +45,36 @@ let is_inspecting_signal = false;
|
|
|
|
|
|
|
|
|
|
// Handle effect queues
|
|
|
|
|
|
|
|
|
|
/** @type {import('./types.js').Effect[]} */
|
|
|
|
|
/** @type {import('#client').Effect[]} */
|
|
|
|
|
let current_queued_pre_and_render_effects = [];
|
|
|
|
|
|
|
|
|
|
/** @type {import('./types.js').Effect[]} */
|
|
|
|
|
/** @type {import('#client').Effect[]} */
|
|
|
|
|
let current_queued_effects = [];
|
|
|
|
|
|
|
|
|
|
let flush_count = 0;
|
|
|
|
|
// Handle signal reactivity tree dependencies and consumer
|
|
|
|
|
|
|
|
|
|
/** @type {null | import('./types.js').Reaction} */
|
|
|
|
|
/** @type {null | import('#client').Reaction} */
|
|
|
|
|
export let current_consumer = null;
|
|
|
|
|
|
|
|
|
|
/** @type {null | import('./types.js').Effect} */
|
|
|
|
|
/** @type {null | import('#client').Effect} */
|
|
|
|
|
export let current_effect = null;
|
|
|
|
|
|
|
|
|
|
/** @param {null | import('./types.js').Effect} effect */
|
|
|
|
|
/** @param {null | import('#client').Effect} effect */
|
|
|
|
|
export function set_current_effect(effect) {
|
|
|
|
|
current_effect = effect;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** @type {null | import('./types.js').Signal[]} */
|
|
|
|
|
/** @type {null | import('#client').Signal[]} */
|
|
|
|
|
let current_dependencies = null;
|
|
|
|
|
let current_dependencies_index = 0;
|
|
|
|
|
/**
|
|
|
|
|
* Tracks writes that the effect it's executed in doesn't listen to yet,
|
|
|
|
|
* so that the dependency can be added to the effect later on if it then reads it
|
|
|
|
|
* @type {null | import('./types.js').Signal[]}
|
|
|
|
|
* @type {null | import('#client').Signal[]}
|
|
|
|
|
*/
|
|
|
|
|
let current_untracked_writes = null;
|
|
|
|
|
/** @type {null | import('./types.js').SignalDebug} */
|
|
|
|
|
/** @type {null | import('#client').SignalDebug} */
|
|
|
|
|
let last_inspected_signal = null;
|
|
|
|
|
/** If `true`, `get`ting the signal should not register it as a dependency */
|
|
|
|
|
export let current_untracking = false;
|
|
|
|
|
@ -95,14 +95,14 @@ let captured_signals = new Set();
|
|
|
|
|
/** @type {Function | null} */
|
|
|
|
|
export let inspect_fn = null;
|
|
|
|
|
|
|
|
|
|
/** @type {Array<import('./types.js').SignalDebug>} */
|
|
|
|
|
/** @type {Array<import('#client').SignalDebug>} */
|
|
|
|
|
let inspect_captured_signals = [];
|
|
|
|
|
|
|
|
|
|
// Handling runtime component context
|
|
|
|
|
/** @type {import('./types.js').ComponentContext | null} */
|
|
|
|
|
/** @type {import('#client').ComponentContext | null} */
|
|
|
|
|
export let current_component_context = null;
|
|
|
|
|
|
|
|
|
|
/** @param {import('./types.js').ComponentContext | null} context */
|
|
|
|
|
/** @param {import('#client').ComponentContext | null} context */
|
|
|
|
|
export function set_current_component_context(context) {
|
|
|
|
|
current_component_context = context;
|
|
|
|
|
}
|
|
|
|
|
@ -110,7 +110,7 @@ export function set_current_component_context(context) {
|
|
|
|
|
export let updating_derived = false;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {null | import('./types.js').ComponentContext} context
|
|
|
|
|
* @param {null | import('#client').ComponentContext} context
|
|
|
|
|
* @returns {boolean}
|
|
|
|
|
*/
|
|
|
|
|
function is_runes(context) {
|
|
|
|
|
@ -119,7 +119,7 @@ function is_runes(context) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {import('./types.js').ProxyStateObject} target
|
|
|
|
|
* @param {import('#client').ProxyStateObject} target
|
|
|
|
|
* @param {string | symbol} prop
|
|
|
|
|
* @param {any} receiver
|
|
|
|
|
*/
|
|
|
|
|
@ -152,7 +152,7 @@ export function batch_inspect(target, prop, receiver) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Signal<V>} signal
|
|
|
|
|
* @param {import('#client').Signal<V>} signal
|
|
|
|
|
* @returns {boolean}
|
|
|
|
|
*/
|
|
|
|
|
function is_signal_dirty(signal) {
|
|
|
|
|
@ -161,7 +161,7 @@ function is_signal_dirty(signal) {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
if ((flags & MAYBE_DIRTY) !== 0) {
|
|
|
|
|
const dependencies = /** @type {import('./types.js').Reaction} **/ (signal).d;
|
|
|
|
|
const dependencies = /** @type {import('#client').Reaction} **/ (signal).d;
|
|
|
|
|
if (dependencies !== null) {
|
|
|
|
|
const length = dependencies.length;
|
|
|
|
|
let i;
|
|
|
|
|
@ -174,7 +174,7 @@ function is_signal_dirty(signal) {
|
|
|
|
|
// The flags can be marked as dirty from the above is_signal_dirty call.
|
|
|
|
|
if ((dependency.f & DIRTY) !== 0) {
|
|
|
|
|
if ((dependency.f & DERIVED) !== 0) {
|
|
|
|
|
update_derived(/** @type {import('./types.js').Reaction} **/ (dependency), true);
|
|
|
|
|
update_derived(/** @type {import('#client').Reaction} **/ (dependency), true);
|
|
|
|
|
// Might have been mutated from above get.
|
|
|
|
|
if ((signal.f & DIRTY) !== 0) {
|
|
|
|
|
return true;
|
|
|
|
|
@ -202,7 +202,7 @@ function is_signal_dirty(signal) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Reaction} signal
|
|
|
|
|
* @param {import('#client').Reaction} signal
|
|
|
|
|
* @returns {V}
|
|
|
|
|
*/
|
|
|
|
|
function execute_signal_fn(signal) {
|
|
|
|
|
@ -216,7 +216,7 @@ function execute_signal_fn(signal) {
|
|
|
|
|
const previous_skip_consumer = current_skip_consumer;
|
|
|
|
|
const is_render_effect = (flags & RENDER_EFFECT) !== 0;
|
|
|
|
|
const previous_untracking = current_untracking;
|
|
|
|
|
current_dependencies = /** @type {null | import('./types.js').Signal[]} */ (null);
|
|
|
|
|
current_dependencies = /** @type {null | import('#client').Signal[]} */ (null);
|
|
|
|
|
current_dependencies_index = 0;
|
|
|
|
|
current_untracked_writes = null;
|
|
|
|
|
current_consumer = signal;
|
|
|
|
|
@ -227,14 +227,14 @@ function execute_signal_fn(signal) {
|
|
|
|
|
try {
|
|
|
|
|
let res;
|
|
|
|
|
if (is_render_effect) {
|
|
|
|
|
res = /** @type {(block: null, signal: import('./types.js').Signal) => V} */ (init)(
|
|
|
|
|
res = /** @type {(block: null, signal: import('#client').Signal) => V} */ (init)(
|
|
|
|
|
null,
|
|
|
|
|
/** @type {import('./types.js').Signal} */ (signal)
|
|
|
|
|
/** @type {import('#client').Signal} */ (signal)
|
|
|
|
|
);
|
|
|
|
|
} else {
|
|
|
|
|
res = /** @type {() => V} */ (init)();
|
|
|
|
|
}
|
|
|
|
|
let dependencies = /** @type {import('./types.js').Signal<unknown>[]} **/ (signal.d);
|
|
|
|
|
let dependencies = /** @type {import('#client').Signal<unknown>[]} **/ (signal.d);
|
|
|
|
|
if (current_dependencies !== null) {
|
|
|
|
|
let i;
|
|
|
|
|
if (dependencies !== null) {
|
|
|
|
|
@ -269,7 +269,7 @@ function execute_signal_fn(signal) {
|
|
|
|
|
dependencies[current_dependencies_index + i] = current_dependencies[i];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
signal.d = /** @type {import('./types.js').Signal<V>[]} **/ (
|
|
|
|
|
signal.d = /** @type {import('#client').Signal<V>[]} **/ (
|
|
|
|
|
dependencies = current_dependencies
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
@ -308,8 +308,8 @@ function execute_signal_fn(signal) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Derived<V>} signal
|
|
|
|
|
* @param {import('./types.js').Signal<V>} dependency
|
|
|
|
|
* @param {import('#client').Reaction} signal
|
|
|
|
|
* @param {import('#client').Signal<V>} dependency
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
function remove_consumer(signal, dependency) {
|
|
|
|
|
@ -331,13 +331,13 @@ function remove_consumer(signal, dependency) {
|
|
|
|
|
if (consumers_length === 0 && (dependency.f & UNOWNED) !== 0) {
|
|
|
|
|
// If the signal is unowned then we need to make sure to change it to dirty.
|
|
|
|
|
set_signal_status(dependency, DIRTY);
|
|
|
|
|
remove_consumers(/** @type {import('./types.js').Derived<V>} **/ (dependency), 0);
|
|
|
|
|
remove_consumers(/** @type {import('#client').Derived<V>} **/ (dependency), 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Derived<V>} signal
|
|
|
|
|
* @param {import('#client').Reaction} signal
|
|
|
|
|
* @param {number} start_index
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
@ -358,7 +358,7 @@ function remove_consumers(signal, start_index) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Reaction} signal
|
|
|
|
|
* @param {import('#client').Reaction} signal
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
function destroy_references(signal) {
|
|
|
|
|
@ -373,7 +373,7 @@ function destroy_references(signal) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {import('./types.js').Effect} signal
|
|
|
|
|
* @param {import('#client').Effect} signal
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
export function execute_effect(signal) {
|
|
|
|
|
@ -426,7 +426,7 @@ function infinite_loop_guard() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {Array<import('./types.js').Effect>} effects
|
|
|
|
|
* @param {Array<import('#client').Effect>} effects
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
function flush_queued_effects(effects) {
|
|
|
|
|
@ -474,7 +474,7 @@ function process_microtask() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {import('./types.js').Effect} signal
|
|
|
|
|
* @param {import('#client').Effect} signal
|
|
|
|
|
* @param {boolean} sync
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
@ -569,7 +569,7 @@ export function flush_local_render_effects() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {null | import('./types.js').ComponentContext} context
|
|
|
|
|
* @param {null | import('#client').ComponentContext} context
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
export function flush_local_pre_effects(context) {
|
|
|
|
|
@ -609,10 +609,10 @@ export function flush_sync(fn, flush_previous = true) {
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
infinite_loop_guard();
|
|
|
|
|
/** @type {import('./types.js').Effect[]} */
|
|
|
|
|
/** @type {import('#client').Effect[]} */
|
|
|
|
|
const pre_and_render_effects = [];
|
|
|
|
|
|
|
|
|
|
/** @type {import('./types.js').Effect[]} */
|
|
|
|
|
/** @type {import('#client').Effect[]} */
|
|
|
|
|
const effects = [];
|
|
|
|
|
current_scheduler_mode = FLUSH_SYNC;
|
|
|
|
|
current_queued_pre_and_render_effects = pre_and_render_effects;
|
|
|
|
|
@ -651,7 +651,7 @@ export async function tick() {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Reaction} signal
|
|
|
|
|
* @param {import('#client').Reaction} signal
|
|
|
|
|
* @param {boolean} force_schedule
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
@ -666,27 +666,27 @@ function update_derived(signal, force_schedule) {
|
|
|
|
|
? MAYBE_DIRTY
|
|
|
|
|
: CLEAN;
|
|
|
|
|
set_signal_status(signal, status);
|
|
|
|
|
const equals = /** @type {import('./types.js').EqualsFunctions} */ (signal.e);
|
|
|
|
|
const equals = /** @type {import('#client').EqualsFunctions} */ (signal.e);
|
|
|
|
|
if (!equals(value, signal.v)) {
|
|
|
|
|
signal.v = value;
|
|
|
|
|
mark_signal_consumers(signal, DIRTY, force_schedule);
|
|
|
|
|
|
|
|
|
|
// @ts-expect-error
|
|
|
|
|
if (DEV && signal.inspect && force_schedule) {
|
|
|
|
|
for (const fn of /** @type {import('./types.js').SignalDebug} */ (signal).inspect) fn();
|
|
|
|
|
for (const fn of /** @type {import('#client').SignalDebug} */ (signal).inspect) fn();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').ValueSignal<V>} signal
|
|
|
|
|
* @param {import('#client').ValueSignal<V>} signal
|
|
|
|
|
* @returns {V}
|
|
|
|
|
*/
|
|
|
|
|
export function get(signal) {
|
|
|
|
|
// @ts-expect-error
|
|
|
|
|
if (DEV && signal.inspect && inspect_fn) {
|
|
|
|
|
/** @type {import('./types.js').SignalDebug} */ (signal).inspect.add(inspect_fn);
|
|
|
|
|
/** @type {import('#client').SignalDebug} */ (signal).inspect.add(inspect_fn);
|
|
|
|
|
// @ts-expect-error
|
|
|
|
|
inspect_captured_signals.push(signal);
|
|
|
|
|
}
|
|
|
|
|
@ -739,10 +739,10 @@ export function get(signal) {
|
|
|
|
|
// we want to avoid tracking indirect dependencies
|
|
|
|
|
const previous_inspect_fn = inspect_fn;
|
|
|
|
|
inspect_fn = null;
|
|
|
|
|
update_derived(/** @type {import('./types.js').Reaction} **/ (signal), false);
|
|
|
|
|
update_derived(/** @type {import('#client').Reaction} **/ (signal), false);
|
|
|
|
|
inspect_fn = previous_inspect_fn;
|
|
|
|
|
} else {
|
|
|
|
|
update_derived(/** @type {import('./types.js').Reaction} **/ (signal), false);
|
|
|
|
|
update_derived(/** @type {import('#client').Reaction} **/ (signal), false);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return signal.v;
|
|
|
|
|
@ -750,7 +750,7 @@ export function get(signal) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Signal<V>} signal
|
|
|
|
|
* @param {import('#client').Signal<V>} signal
|
|
|
|
|
* @param {V} value
|
|
|
|
|
* @returns {V}
|
|
|
|
|
*/
|
|
|
|
|
@ -761,7 +761,7 @@ export function set(signal, value) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Signal<V>} signal
|
|
|
|
|
* @param {import('#client').Signal<V>} signal
|
|
|
|
|
* @param {V} value
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
@ -799,7 +799,7 @@ export function invalidate_inner_signals(fn) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Signal<V>} source
|
|
|
|
|
* @param {import('#client').Signal<V>} source
|
|
|
|
|
* @param {V} value
|
|
|
|
|
*/
|
|
|
|
|
export function mutate(source, value) {
|
|
|
|
|
@ -812,7 +812,7 @@ export function mutate(source, value) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Signal<V>} signal
|
|
|
|
|
* @param {import('#client').Signal<V>} signal
|
|
|
|
|
* @param {number} to_status
|
|
|
|
|
* @param {boolean} force_schedule
|
|
|
|
|
* @returns {void}
|
|
|
|
|
@ -840,7 +840,7 @@ function mark_signal_consumers(signal, to_status, force_schedule) {
|
|
|
|
|
const maybe_dirty = (flags & MAYBE_DIRTY) !== 0;
|
|
|
|
|
if ((flags & CLEAN) !== 0 || (maybe_dirty && unowned)) {
|
|
|
|
|
if ((consumer.f & IS_EFFECT) !== 0) {
|
|
|
|
|
schedule_effect(/** @type {import('./types.js').Effect} */ (consumer), false);
|
|
|
|
|
schedule_effect(/** @type {import('#client').Effect} */ (consumer), false);
|
|
|
|
|
} else {
|
|
|
|
|
mark_signal_consumers(consumer, MAYBE_DIRTY, force_schedule);
|
|
|
|
|
}
|
|
|
|
|
@ -851,7 +851,7 @@ function mark_signal_consumers(signal, to_status, force_schedule) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Signal<V>} signal
|
|
|
|
|
* @param {import('#client').Signal<V>} signal
|
|
|
|
|
* @param {V} value
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
@ -874,7 +874,7 @@ export function set_signal_value(signal, value) {
|
|
|
|
|
}
|
|
|
|
|
if (
|
|
|
|
|
(signal.f & SOURCE) !== 0 &&
|
|
|
|
|
!(/** @type {import('./types.js').EqualsFunctions} */ (signal.e)(value, signal.v))
|
|
|
|
|
!(/** @type {import('#client').EqualsFunctions} */ (signal.e)(value, signal.v))
|
|
|
|
|
) {
|
|
|
|
|
signal.v = value;
|
|
|
|
|
// Increment write version so that unowned signals can properly track dirtyness
|
|
|
|
|
@ -913,9 +913,9 @@ export function set_signal_value(signal, value) {
|
|
|
|
|
// @ts-expect-error
|
|
|
|
|
if (DEV && signal.inspect) {
|
|
|
|
|
if (is_batching_effect) {
|
|
|
|
|
last_inspected_signal = /** @type {import('./types.js').SignalDebug} */ (signal);
|
|
|
|
|
last_inspected_signal = /** @type {import('#client').SignalDebug} */ (signal);
|
|
|
|
|
} else {
|
|
|
|
|
for (const fn of /** @type {import('./types.js').SignalDebug} */ (signal).inspect) fn();
|
|
|
|
|
for (const fn of /** @type {import('#client').SignalDebug} */ (signal).inspect) fn();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -923,7 +923,7 @@ export function set_signal_value(signal, value) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Reaction} signal
|
|
|
|
|
* @param {import('#client').Reaction} signal
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
export function destroy_signal(signal) {
|
|
|
|
|
@ -967,7 +967,7 @@ export function untrack(fn) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Reaction} signal
|
|
|
|
|
* @param {import('#client').Effect} signal
|
|
|
|
|
* @param {() => void} destroy_fn
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
@ -985,7 +985,7 @@ export function push_destroy_fn(signal, destroy_fn) {
|
|
|
|
|
const STATUS_MASK = ~(DIRTY | MAYBE_DIRTY | CLEAN);
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {import('./types.js').Signal<V>} signal
|
|
|
|
|
* @param {import('#client').Signal<V>} signal
|
|
|
|
|
* @param {number} status
|
|
|
|
|
* @returns {void}
|
|
|
|
|
*/
|
|
|
|
|
@ -995,14 +995,14 @@ function set_signal_status(signal, status) {
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @template V
|
|
|
|
|
* @param {V | import('./types.js').Signal<V>} val
|
|
|
|
|
* @returns {val is import('./types.js').Signal<V>}
|
|
|
|
|
* @param {V | import('#client').Signal<V>} val
|
|
|
|
|
* @returns {val is import('#client').Signal<V>}
|
|
|
|
|
*/
|
|
|
|
|
export function is_signal(val) {
|
|
|
|
|
return (
|
|
|
|
|
typeof val === 'object' &&
|
|
|
|
|
val !== null &&
|
|
|
|
|
typeof (/** @type {import('./types.js').Signal<V>} */ (val).f) === 'number'
|
|
|
|
|
typeof (/** @type {import('#client').Signal<V>} */ (val).f) === 'number'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1019,7 +1019,7 @@ export function get_or_init_context_map() {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {import('./types.js').ComponentContext} component_context
|
|
|
|
|
* @param {import('#client').ComponentContext} component_context
|
|
|
|
|
* @returns {Map<unknown, unknown> | null}
|
|
|
|
|
*/
|
|
|
|
|
function get_parent_context(component_context) {
|
|
|
|
|
@ -1035,7 +1035,7 @@ function get_parent_context(component_context) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {import('./types.js').ValueSignal<number>} signal
|
|
|
|
|
* @param {import('#client').ValueSignal<number>} signal
|
|
|
|
|
* @param {1 | -1} [d]
|
|
|
|
|
* @returns {number}
|
|
|
|
|
*/
|
|
|
|
|
@ -1057,7 +1057,7 @@ export function update_prop(fn, d = 1) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @param {import('./types.js').ValueSignal<number>} signal
|
|
|
|
|
* @param {import('#client').ValueSignal<number>} signal
|
|
|
|
|
* @param {1 | -1} [d]
|
|
|
|
|
* @returns {number}
|
|
|
|
|
*/
|
|
|
|
|
|