Skip to main content

Class: PageManager

@ima/core.PageManager

The page manager is a utility for managing the current controller and its view.

Hierarchy

Constructors

constructor

new PageManager()

Methods

destroy

destroy(): Promise<unknown>

Finalization callback, called when the page manager is being discarded. This usually happens when the page is hot-reloaded at the client side.

Returns

Promise<unknown>

Defined in

packages/core/src/page/manager/PageManager.ts:68


init

init(): void

Initializes the page manager.

Returns

void

Defined in

packages/core/src/page/manager/PageManager.ts:20


manage

manage(args): Promise<unknown>

Starts to manage the provided controller and its view. The manager stops the management of any previously managed controller and view.

The controller and view will be initialized and rendered either into the UI (at the client-side) or to the response to send to the client (at the server-side).

Parameters

NameType
argsManageArgs

Returns

Promise<unknown>

A promise that will resolve to information about the rendered page. The status will contain the HTTP status code to send to the client (at the server side) or determine the type of error page to navigate to (at the client side).

Defined in

packages/core/src/page/manager/PageManager.ts:53


postManage

postManage(): void

Called by router after currently managed route is resolved.

Returns

void

Defined in

packages/core/src/page/manager/PageManager.ts:60


preManage

preManage(): Promise<void>

Pre manage handler, should be called and awaited before tryint to handle new route handler. This pre manage takes care of canceling any currently executed route handlers and returns promise which is resolved when previous page finished loading (even if it got canceled).

Returns

Promise<void>

Defined in

packages/core/src/page/manager/PageManager.ts:30