summaryrefslogtreecommitdiff
path: root/src/frontend/render/renderer.ts
diff options
context:
space:
mode:
authorGravatar Drew Powers <1369770+drwpow@users.noreply.github.com> 2021-04-02 10:16:16 -0600
committerGravatar GitHub <noreply@github.com> 2021-04-02 10:16:16 -0600
commit003b3c395f81df26010112928a30c2d88f283b53 (patch)
tree6dd9057a0758eb1030018062a72126a8efb9f098 /src/frontend/render/renderer.ts
parent2646f800af80703ae6498232d270a4637fe56dca (diff)
downloadastro-003b3c395f81df26010112928a30c2d88f283b53.tar.gz
astro-003b3c395f81df26010112928a30c2d88f283b53.tar.zst
astro-003b3c395f81df26010112928a30c2d88f283b53.zip
Get CSS Modules working in Vue (#53)
Diffstat (limited to 'src/frontend/render/renderer.ts')
-rw-r--r--src/frontend/render/renderer.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/frontend/render/renderer.ts b/src/frontend/render/renderer.ts
index 272f4ef5c..e0d1fccce 100644
--- a/src/frontend/render/renderer.ts
+++ b/src/frontend/render/renderer.ts
@@ -5,7 +5,7 @@ interface DynamicRenderContext {
}
export interface Renderer {
- renderStatic(Component: any): (props: Record<string, any>, ...children: any[]) => string;
+ renderStatic(Component: any): (props: Record<string, any>, ...children: any[]) => Promise<string>;
render(context: { root: string; Component: string; props: string; [key: string]: string }): string;
imports?: Record<string, string[]>;
}
@@ -36,10 +36,10 @@ export function createRenderer(renderer: Renderer) {
wrapperEnd: string | ((context: ReturnType<typeof createContext>) => string)
) => (Component: any, renderContext: DynamicRenderContext) => {
const innerContext = createContext();
- return (props: Record<string, any>, ...children: any[]) => {
+ return async (props: Record<string, any>, ...children: any[]) => {
let value: string;
try {
- value = _static(Component)(props, ...children);
+ value = await _static(Component)(props, ...children);
} catch (e) {
value = '';
}