mirror of https://github.com/sveltejs/svelte
chore: move `slot` function into its own module (#12357)
parent
94197b069e
commit
056a1aeb89
@ -0,0 +1,15 @@
|
||||
/**
|
||||
* @param {Comment} anchor
|
||||
* @param {void | ((anchor: Comment, slot_props: Record<string, unknown>) => void)} slot_fn
|
||||
* @param {Record<string, unknown>} slot_props
|
||||
* @param {null | ((anchor: Comment) => void)} fallback_fn
|
||||
*/
|
||||
export function slot(anchor, slot_fn, slot_props, fallback_fn) {
|
||||
if (slot_fn === undefined) {
|
||||
if (fallback_fn !== null) {
|
||||
fallback_fn(anchor);
|
||||
}
|
||||
} else {
|
||||
slot_fn(anchor, slot_props);
|
||||
}
|
||||
}
|
Loading…
Reference in new issue