Home / Function/ legacy_rest_props_handler.set() — svelte Function Reference

legacy_rest_props_handler.set() — svelte Function Reference

Architecture documentation for the legacy_rest_props_handler.set() function in props.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  986e6f95_919f_827c_489d_ff0c8b9ff69d["legacy_rest_props_handler.set()"]
  5094c0e2_0832_85dc_9c83_43e20571b709["props.js"]
  986e6f95_919f_827c_489d_ff0c8b9ff69d -->|defined in| 5094c0e2_0832_85dc_9c83_43e20571b709
  63ee8247_ada4_9f1d_e139_0c1167cd5b1c["set()"]
  986e6f95_919f_827c_489d_ff0c8b9ff69d -->|calls| 63ee8247_ada4_9f1d_e139_0c1167cd5b1c
  55623862_10b7_5361_e30b_34ec6941f1a7["set_active_effect()"]
  986e6f95_919f_827c_489d_ff0c8b9ff69d -->|calls| 55623862_10b7_5361_e30b_34ec6941f1a7
  665ade04_d03d_9b82_ca8d_aba0158bc3b7["prop()"]
  986e6f95_919f_827c_489d_ff0c8b9ff69d -->|calls| 665ade04_d03d_9b82_ca8d_aba0158bc3b7
  5d33d764_c539_b815_fe49_97b00f61f68e["update()"]
  986e6f95_919f_827c_489d_ff0c8b9ff69d -->|calls| 5d33d764_c539_b815_fe49_97b00f61f68e
  style 986e6f95_919f_827c_489d_ff0c8b9ff69d fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/internal/client/reactivity/props.js lines 109–135

	set(target, key, value) {
		if (!(key in target.special)) {
			var previous_effect = active_effect;

			try {
				set_active_effect(target.parent_effect);

				// Handle props that can temporarily get out of sync with the parent
				/** @type {Record<string, (v?: unknown) => unknown>} */
				target.special[key] = prop(
					{
						get [key]() {
							return target.props[key];
						}
					},
					/** @type {string} */ (key),
					PROPS_IS_UPDATED
				);
			} finally {
				set_active_effect(previous_effect);
			}
		}

		target.special[key](value);
		update(target.version); // $$props is coarse-grained: when $$props.x is updated, usages of $$props.y etc are also rerun
		return true;
	},

Domain

Subdomains

Frequently Asked Questions

What does legacy_rest_props_handler.set() do?
legacy_rest_props_handler.set() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/reactivity/props.js.
Where is legacy_rest_props_handler.set() defined?
legacy_rest_props_handler.set() is defined in packages/svelte/src/internal/client/reactivity/props.js at line 109.
What does legacy_rest_props_handler.set() call?
legacy_rest_props_handler.set() calls 4 function(s): prop, set, set_active_effect, update.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free