lazyScene beta
Function of @v12-engine/client/app
ts
export declare function lazyScene<A extends object = {}>(id: string, name: string, fetch: () => Promise<Scene<A>>, options?: {
names?: readonly SceneRef<any>[];
kind?: SceneKind;
shows?: SceneShows;
transition?: SceneTransition;
}): LazyScene<A>;A scene whose code is fetched when it is first opened (LazyScene): fetch is an import() of the module that makes it, and what it gives must have the same id. What the scene fetched names (its way out, its buttons) is said here (names), so the app checks it is there as it starts, before anything is fetched
lazyScene('dev', 'Dev sandbox', () = import('./dev').then((module) = module.devScene), names: [home] )