Function operationMode

  • Returns the current "operation mode" of the device.

    This can be used to identify if the device is handheld or docked.

    Returns number

    Example

    import { OperationMode } from '@nx.js/constants';

    if (Switch.operationMode() === OperationMode.Handheld) {
    console.log('Device is currently handheld');
    } else {
    console.log('Device is currently docked');
    }

Generated using TypeDoc