Skip to content

Commit 784042d

Browse files
committed
Add simple getLive util
1 parent ba6f9d6 commit 784042d

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

assets/js/live_svelte/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
export {getRender} from "./render"
22
export {getHooks} from "./hooks"
3+
export {getLive} from "./utils"

assets/js/live_svelte/types.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ export type Live = {
1111

1212
export declare const getHooks: (components: object) => object
1313
export declare const getRender: (components: object) => (name: string, props: object, slots: object) => any
14+
export declare const getLive: (getContext: (key: string) => any) => Live

assets/js/live_svelte/utils.js

+4
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@ export function normalizeComponents(components) {
99
}
1010
return normalized
1111
}
12+
13+
export function getLive(getContext) {
14+
return getContext("live-svelte")
15+
}

0 commit comments

Comments
 (0)