File tree 3 files changed +17
-17
lines changed
packages/svelte/src/internal/client 3 files changed +17
-17
lines changed Original file line number Diff line number Diff line change
1
+ /**
2
+ * @param {Comment } anchor
3
+ * @param {void | ((anchor: Comment, slot_props: Record<string, unknown>) => void) } slot_fn
4
+ * @param {Record<string, unknown> } slot_props
5
+ * @param {null | ((anchor: Comment) => void) } fallback_fn
6
+ */
7
+ export function slot ( anchor , slot_fn , slot_props , fallback_fn ) {
8
+ if ( slot_fn === undefined ) {
9
+ if ( fallback_fn !== null ) {
10
+ fallback_fn ( anchor ) ;
11
+ }
12
+ } else {
13
+ slot_fn ( anchor , slot_props ) ;
14
+ }
15
+ }
Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ export { key_block as key } from './dom/blocks/key.js';
15
15
export { css_props } from './dom/blocks/css-props.js' ;
16
16
export { index , each } from './dom/blocks/each.js' ;
17
17
export { html } from './dom/blocks/html.js' ;
18
+ export { slot } from './dom/blocks/slot.js' ;
18
19
export { snippet , wrap_snippet } from './dom/blocks/snippet.js' ;
19
20
export { component } from './dom/blocks/svelte-component.js' ;
20
21
export { element } from './dom/blocks/svelte-element.js' ;
@@ -118,7 +119,7 @@ export {
118
119
update_pre_store ,
119
120
update_store
120
121
} from './reactivity/store.js' ;
121
- export { append_styles , sanitize_slots , set_text , slot } from './render.js' ;
122
+ export { append_styles , sanitize_slots , set_text } from './render.js' ;
122
123
export {
123
124
get ,
124
125
invalidate_inner_signals ,
Original file line number Diff line number Diff line change @@ -49,22 +49,6 @@ export function set_text(text, value) {
49
49
}
50
50
}
51
51
52
- /**
53
- * @param {Comment } anchor
54
- * @param {void | ((anchor: Comment, slot_props: Record<string, unknown>) => void) } slot_fn
55
- * @param {Record<string, unknown> } slot_props
56
- * @param {null | ((anchor: Comment) => void) } fallback_fn
57
- */
58
- export function slot ( anchor , slot_fn , slot_props , fallback_fn ) {
59
- if ( slot_fn === undefined ) {
60
- if ( fallback_fn !== null ) {
61
- fallback_fn ( anchor ) ;
62
- }
63
- } else {
64
- slot_fn ( anchor , slot_props ) ;
65
- }
66
- }
67
-
68
52
/**
69
53
* Mounts a component to the given target and returns the exports and potentially the props (if compiled with `accessors: true`) of the component.
70
54
* Transitions will play during the initial render unless the `intro` option is set to `false`.
You can’t perform that action at this time.
0 commit comments