GitHubPixels Website
  • Preparing search index...
  • The search index is not available
Documentation
  • Documentation
  • @systemic-games/react-native-pixels-connect
  • usePixelScannerNotify

Function usePixelScannerNotify

  • usePixelScannerNotify<T>(updateItems, opt?): [T[], ((action: PixelScannerDispatchAction) => void), PixelScannerStatus]
  • React hook that creates PixelScanner to scan for Pixels using Bluetooth.

    Type Parameters

    • T

    Parameters

    • updateItems: ((items: T[], ops: readonly PixelScannerListOperation[]) => T[])

      Callback that maps ScannedPixel to the desired type. The returned array is stored in the React state value that is returned by this function. As such, a new array must be returned to trigger a React state update. Parameters:

      • items: The last returned array of T objects.
      • updates: The list of new or updated ScannedPixel along with their new and previous index in the list (undefined for new items).
      • Returns: The updated list of T objects.
        • (items, ops): T[]
        • Parameters

          • items: T[]
          • ops: readonly PixelScannerListOperation[]

          Returns T[]

    • Optionalopt: PixelScannerOptions

      Optional arguments, see PixelScannerOptions.

    Returns [T[], ((action: PixelScannerDispatchAction) => void), PixelScannerStatus]

    An array with:

    • The list of T objects corresponding to the scanned Pixels.
    • A stable reducer like function to dispatch actions to the scanner.
    • The scan status or the last error.

    Remarks

    This hook is reserved for advanced usage. There are simpler hooks such as useScannedPixels or useScannedPixelNotifiers.

    • Defined in packages/react-native-pixels-connect/src/hooks/usePixelScannerNotify.ts:68

Settings

Member Visibility
GitHubPixels Website
Documentation
  • Loading...

Generated using TypeDoc