Skip to content

Commit

Permalink
check remixContext is promise or not
Browse files Browse the repository at this point in the history
  • Loading branch information
yusukebe committed Nov 16, 2024
1 parent 150bfd1 commit 37cda75
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const handle = (userApp?: Hono, options?: Options) => {
const args = createGetLoadContextArgs(c)

const remixContext = getLoadContext(args)
return handler(c.req.raw, remixContext)
return handler(c.req.raw, remixContext instanceof Promise ? await remixContext : remixContext)
})

return app
Expand Down
2 changes: 1 addition & 1 deletion src/remix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type GetLoadContext = (args: {
}) => AppLoadContext | Promise<AppLoadContext>

// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const defaultGetLoadContext = ({ context }: any) => {
export const defaultGetLoadContext = ({ context }: any): AppLoadContext => {
return {
...context,
}
Expand Down

1 comment on commit 37cda75

@predaytor
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Neat! ❤️

Please sign in to comment.