Home / Function/ beforeUpdate() — svelte Function Reference

beforeUpdate() — svelte Function Reference

Architecture documentation for the beforeUpdate() function in index-client.js from the svelte codebase.

Entity Profile

Dependency Diagram

graph TD
  c08d3420_7d20_e19c_0153_146d66a863ae["beforeUpdate()"]
  717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2["index-client.js"]
  c08d3420_7d20_e19c_0153_146d66a863ae -->|defined in| 717fc8d5_bdb4_4b73_d6c5_c4a367a60cf2
  f4c1fb39_183b_45f6_47d1_14c159f6ec66["lifecycle_legacy_only()"]
  c08d3420_7d20_e19c_0153_146d66a863ae -->|calls| f4c1fb39_183b_45f6_47d1_14c159f6ec66
  69870c62_aad9_b77a_8c01_8940b029a029["init_update_callbacks()"]
  c08d3420_7d20_e19c_0153_146d66a863ae -->|calls| 69870c62_aad9_b77a_8c01_8940b029a029
  ea5280ff_3b87_42ee_3823_3570b76a5779["push()"]
  c08d3420_7d20_e19c_0153_146d66a863ae -->|calls| ea5280ff_3b87_42ee_3823_3570b76a5779
  style c08d3420_7d20_e19c_0153_146d66a863ae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/svelte/src/index-client.js lines 200–210

export function beforeUpdate(fn) {
	if (component_context === null) {
		e.lifecycle_outside_component('beforeUpdate');
	}

	if (component_context.l === null) {
		e.lifecycle_legacy_only('beforeUpdate');
	}

	init_update_callbacks(component_context).b.push(fn);
}

Subdomains

Frequently Asked Questions

What does beforeUpdate() do?
beforeUpdate() is a function in the svelte codebase, defined in packages/svelte/src/index-client.js.
Where is beforeUpdate() defined?
beforeUpdate() is defined in packages/svelte/src/index-client.js at line 200.
What does beforeUpdate() call?
beforeUpdate() calls 3 function(s): init_update_callbacks, lifecycle_legacy_only, push.

Analyze Your Own Codebase

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

Try Supermodel Free