Class: AppView
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
Name | Type |
---|---|
T |
extends AppViewProps = AppViewProps |
Hierarchy
-
DisplayComponent
<T
>↳
AppView
Implements
GamepadEventHandler
Properties
defaultView
• Protected
Optional
Readonly
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
• Optional
Readonly
contextType: readonly []
The type of context for this component, if any.
Inherited from
DisplayComponent.contextType
Accessors
appViewService
• get
appViewService(): AppViewService
Get AppViewService instance
Returns
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
Name | Type | Description |
---|---|---|
time |
number |
in 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 <div class="my-custom-class">{super.render()}</div>;
}
Example
Here's an plain JSX/TSX example:
public render(): TVNode<HTMLSpanElement> {
return <span>Hello World!</span>;
}
Overrides
DisplayComponent.render
onAfterRender
▸ onAfterRender(node
): void
Parameters
Name | Type |
---|---|
node |
VNode |
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
Name | Type | Description |
---|---|---|
context |
never |
The 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