apply() — svelte Function Reference
Architecture documentation for the apply() function in batch.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD 58e25076_0e70_68a7_dbf9_e13ef9845ff2["apply()"] 517c145b_769f_b163_6854_d8f2a4412e11["Batch"] 58e25076_0e70_68a7_dbf9_e13ef9845ff2 -->|defined in| 517c145b_769f_b163_6854_d8f2a4412e11 3ceb9b1c_7062_d75e_744a_fd12a80dfdc9["reconcile()"] 3ceb9b1c_7062_d75e_744a_fd12a80dfdc9 -->|calls| 58e25076_0e70_68a7_dbf9_e13ef9845ff2 05511be0_1e56_3876_59e2_7350fc912bb9["process()"] 05511be0_1e56_3876_59e2_7350fc912bb9 -->|calls| 58e25076_0e70_68a7_dbf9_e13ef9845ff2 e2994140_cbea_e6ee_c66f_0adec4e39cd7["activate()"] e2994140_cbea_e6ee_c66f_0adec4e39cd7 -->|calls| 58e25076_0e70_68a7_dbf9_e13ef9845ff2 dd2db25f_ec55_d3be_61b9_c180c4e4cbc8["batches()"] dd2db25f_ec55_d3be_61b9_c180c4e4cbc8 -->|calls| 58e25076_0e70_68a7_dbf9_e13ef9845ff2 1edde895_4b1f_7b83_74c8_3640bf220ca9["run_test_variant()"] 1edde895_4b1f_7b83_74c8_3640bf220ca9 -->|calls| 58e25076_0e70_68a7_dbf9_e13ef9845ff2 63ee8247_ada4_9f1d_e139_0c1167cd5b1c["set()"] 58e25076_0e70_68a7_dbf9_e13ef9845ff2 -->|calls| 63ee8247_ada4_9f1d_e139_0c1167cd5b1c style 58e25076_0e70_68a7_dbf9_e13ef9845ff2 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/src/internal/client/reactivity/batch.js lines 536–553
apply() {
if (!async_mode_flag || (!this.is_fork && batches.size === 1)) return;
// if there are multiple batches, we are 'time travelling' —
// we need to override values with the ones in this batch...
batch_values = new Map(this.current);
// ...and undo changes belonging to other batches
for (const batch of batches) {
if (batch === this) continue;
for (const [source, previous] of batch.previous) {
if (!batch_values.has(source)) {
batch_values.set(source, previous);
}
}
}
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does apply() do?
apply() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/reactivity/batch.js.
Where is apply() defined?
apply() is defined in packages/svelte/src/internal/client/reactivity/batch.js at line 536.
What does apply() call?
apply() calls 1 function(s): set.
What calls apply()?
apply() is called by 5 function(s): activate, batches, process, reconcile, run_test_variant.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free