Mandatory class to extend for the App’s render method.

It’s the entrypoint view of every EFB apps.

All events from the EFB are sent to this class when the app is visible.

Type parameters

NameType
Textends AppViewProps = AppViewProps

Hierarchy

  • DisplayComponent<T>

    AppView

Implements

  • GamepadEventHandler

Properties

defaultView

ProtectedOptionalReadonly defaultView: string

Define the view the app should show immediately after being initialized.


props

props: T & ComponentProps

The properties of the component.

Inherited from

DisplayComponent.props


context

Optional context: []

The context on this component, if any.

Inherited from

DisplayComponent.context


contextType

OptionalReadonly contextType: readonly []

The type of context for this component, if any.

Inherited from

DisplayComponent.contextType

Accessors

appViewService

get appViewService(): AppViewService

Get AppViewService instance

Returns

AppViewService

Throws


bus

get bus(): EventBus

Get EventBus instance

Returns

EventBus

Throws


unitsSettingManager

get unitsSettingManager(): UnitsSettingsManager

Get units setting manager instance

Returns

UnitsSettingsManager

Throws


efbSettingsManager

get efbSettingsManager(): EfbSettingsManager

Get general setting manager instance

Returns

EfbSettingsManager

Throws

Methods

onOpen

onOpen(): void

Called once when the view is opened for the first time.

Returns

void


onClose

onClose(): void

Called once when the view is destroyed.

Returns

void


onResume

onResume(): void

Called each time the view is resumed.

Returns

void


onPause

onPause(): void

Called each time the view is closed.

Returns

void


onUpdate

onUpdate(time): void

On Update loop - It update the AppViewService if it is used.

Parameters
NameTypeDescription
timenumberin milliseconds

Returns

void


registerViews

registerViews(): void

Callback to register all views the app might use.

Returns

void


render

render(): TVNode<NodeInstance, T>

If using EFB’s AppViewService, this method returns an AppContainer bound to AppViewService. Otherwise it can be customized with plain JSX/TSX or custom view service, etc…

Returns

TVNode<NodeInstance, T>

Example

Surrounding AppContainer with a custom class:

public render(): TVNode<HTMLDivElement> {
    return {super.render()};
}

Example

Here’s an plain JSX/TSX example:

public render(): TVNode<HTMLSpanElement> {
    return Hello World!;
}
Overrides

DisplayComponent.render


onAfterRender

onAfterRender(node): void

Parameters
NameType
nodeVNode

Returns

void

Inherit Doc

Overrides

DisplayComponent.onAfterRender


onBeforeRender

onBeforeRender(): void

A callback that is called before the component is rendered.

Returns

void

Inherited from

DisplayComponent.onBeforeRender


getContext

getContext(context): never

Gets a context data subscription from the context collection.

Parameters
NameTypeDescription
contextneverThe context to get the subscription for.

Returns

never

The requested context.

Throws

An error if no data for the specified context type could be found.

Inherited from

DisplayComponent.getContext