magic: added a way for running async functions in the top level jsx code
This commit is contained in:
+6
-1
@@ -1,6 +1,11 @@
|
||||
import { DatabaseConnection } from './database'
|
||||
|
||||
export type ServerAsyncCallback = () => Promise<void>
|
||||
|
||||
export type RenderedPage = {
|
||||
html: string
|
||||
metadata: any
|
||||
asyncCallbacks: ServerAsyncCallback[]
|
||||
}
|
||||
|
||||
export type RenderFunction = (url: string) => RenderedPage
|
||||
export type RenderFunction = (url: string, db: DatabaseConnection) => RenderedPage
|
||||
|
||||
Reference in New Issue
Block a user