for_await_track_reactivity_loss() — svelte Function Reference
Architecture documentation for the for_await_track_reactivity_loss() function in async.js from the svelte codebase.
Entity Profile
Dependency Diagram
graph TD 87a0d652_5594_9e6c_5ae4_5b99c4d138f0["for_await_track_reactivity_loss()"] 1ad3e508_c069_abae_2e4a_bd17c8892e18["async.js"] 87a0d652_5594_9e6c_5ae4_5b99c4d138f0 -->|defined in| 1ad3e508_c069_abae_2e4a_bd17c8892e18 3cead1b0_a9df_a632_11a8_a235eac55668["track_reactivity_loss()"] 87a0d652_5594_9e6c_5ae4_5b99c4d138f0 -->|calls| 3cead1b0_a9df_a632_11a8_a235eac55668 style 87a0d652_5594_9e6c_5ae4_5b99c4d138f0 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
packages/svelte/src/internal/client/reactivity/async.js lines 175–208
export async function* for_await_track_reactivity_loss(iterable) {
// This is based on the algorithms described in ECMA-262:
// ForIn/OfBodyEvaluation
// https://tc39.es/ecma262/multipage/ecmascript-language-statements-and-declarations.html#sec-runtime-semantics-forin-div-ofbodyevaluation-lhs-stmt-iterator-lhskind-labelset
// AsyncIteratorClose
// https://tc39.es/ecma262/multipage/abstract-operations.html#sec-asynciteratorclose
/** @type {AsyncIterator<T, TReturn>} */
// @ts-ignore
const iterator = iterable[Symbol.asyncIterator]?.() ?? iterable[Symbol.iterator]?.();
if (iterator === undefined) {
throw new TypeError('value is not async iterable');
}
/** Whether the completion of the iterator was "normal", meaning it wasn't ended via `break` or a similar method */
let normal_completion = false;
try {
while (true) {
const { done, value } = (await track_reactivity_loss(iterator.next()))();
if (done) {
normal_completion = true;
break;
}
yield value;
}
} finally {
// If the iterator had a normal completion and `return` is defined on the iterator, call it and return the value
if (normal_completion && iterator.return !== undefined) {
// eslint-disable-next-line no-unsafe-finally
return /** @type {TReturn} */ ((await track_reactivity_loss(iterator.return()))().value);
}
}
}
Domain
Subdomains
Calls
Source
Frequently Asked Questions
What does for_await_track_reactivity_loss() do?
for_await_track_reactivity_loss() is a function in the svelte codebase, defined in packages/svelte/src/internal/client/reactivity/async.js.
Where is for_await_track_reactivity_loss() defined?
for_await_track_reactivity_loss() is defined in packages/svelte/src/internal/client/reactivity/async.js at line 175.
What does for_await_track_reactivity_loss() call?
for_await_track_reactivity_loss() calls 1 function(s): track_reactivity_loss.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free