Skip to main content

Module flatten_reactive_loops_hir

Module flatten_reactive_loops_hir 

Source
Expand description

Prunes any reactive scopes that are within a loop (for, while, etc). We don’t yet support memoization within loops because this would require an extra layer of reconciliation (plus a way to identify values across runs, similar to how we use key in JSX for lists). Eventually we may integrate more deeply into the runtime so that we can do a single level of reconciliation, but for now we’ve found it’s sufficient to memoize around the loop.

Analogous to TS ReactiveScopes/FlattenReactiveLoopsHIR.ts.

Functions§

flatten_reactive_loops_hir
Flattens reactive scopes that are inside loops by converting Scope terminals to PrunedScope terminals.