Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 | 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 54x 54x 54x 54x 72x 68x 68x 68x 68x 54x 54x 54x 54x | import { EFFECT_TRANSPARENT } from '../../constants.js'; import { branch, render_effect } from '../../reactivity/effects.js'; /** * @template {(node: import('#client').TemplateNode, ...args: any[]) => import('#client').Dom} SnippetFn * @param {() => SnippetFn | null | undefined} get_snippet * @param {import('#client').TemplateNode} node * @param {(() => any)[]} args * @returns {void} */ export function snippet(get_snippet, node, ...args) { /** @type {SnippetFn | null | undefined} */ var snippet; var effect = render_effect(() => { if (snippet === (snippet = get_snippet())) return; if (snippet) { branch(() => /** @type {SnippetFn} */ (snippet)(node, ...args)); } }); effect.f |= EFFECT_TRANSPARENT; } |