Fix export. Add async manifest factory (#67)

This commit is contained in:
Lukasz Ostrowski 2022-10-05 15:07:07 +02:00 committed by GitHub
parent 9b5ed6471d
commit 1504036698
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View file

@ -6,7 +6,7 @@ import { withBaseURL } from "../../middleware";
import { AppManifest } from "../../types";
export type CreateManifestHandlerOptions = {
manifestFactory(context: { appBaseUrl: string }): AppManifest;
manifestFactory(context: { appBaseUrl: string }): AppManifest | Promise<AppManifest>;
};
/**
@ -18,7 +18,7 @@ export const createManifestHandler = (options: CreateManifestHandlerOptions) =>
const baseHandler: Handler = async (request) => {
const { baseURL } = request.context;
const manifest = options.manifestFactory({
const manifest = await options.manifestFactory({
appBaseUrl: baseURL,
});

View file

@ -1 +1,2 @@
export * from "./create-app-register-handler";
export * from "./create-manifest-handler";