External Interface Action

When the user presses a button on the connected thumb controller.

Note that not all events will be sent to all components: For instance, the hub may directly use some actions to control the motor assistance level on e-bikes (this behavior can be turned off via devkit.overrideThumbControllerMapping).

Also, the app might choose to handle some actions directly, for instance to accept incoming calls, manage overlays or close the current module. Parts of that behavior cannot be overriden by DevKit modules (see the documentation for ExternalInterfaceAction for details).

Only when the action is not handled by another component it is sent to the active DevKit module.

const onExternalInterfaceAction = (value: ExternalInterfaceAction, timestamp?: Date) => {
    console.log(value, timestamp);
};

COBI.hub.externalInterfaceAction.subscribe(onExternalInterfaceAction);
COBI.hub.externalInterfaceAction.unsubscribe(onExternalInterfaceAction);
pageExternalInterfaceAction

Last updated