MCPcopy
hub / github.com/sveltejs/svelte / source

Function source

packages/svelte/src/internal/client/reactivity/sources.js:75–94  ·  view source on GitHub ↗
(v, stack)

Source from the content-addressed store, hash-verified

73 */
74// TODO rename this to `state` throughout the codebase
75export function source(v, stack) {
76 /** @type {Value} */
77 var signal = {
78 f: 0, // TODO ideally we could skip this altogether, but it causes type errors
79 v,
80 reactions: null,
81 equals,
82 rv: 0,
83 wv: 0
84 };
85
86 if (DEV && tracing_mode_flag) {
87 signal.created = stack ?? get_error('created at');
88 signal.updated = null;
89 signal.set_during_effect = false;
90 signal.trace = null;
91 }
92
93 return signal;
94}
95
96/**
97 * @template V

Callers 15

createSubscriberFunction · 0.90
#sourceMethod · 0.90
#sourceMethod · 0.90
DevicePixelRatioClass · 0.90
reactive_importFunction · 0.90
create_itemFunction · 0.90
await_blockFunction · 0.90
BoundaryClass · 0.90
legacy_rest_propsFunction · 0.90
eagerFunction · 0.90
async_derivedFunction · 0.90
hmrFunction · 0.90

Calls 1

get_errorFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…