`hasPermission` and `hasDevices` cheat sheet - zxing-js/ngx-scanner GitHub Wiki

Cheat Sheet 💩

How it works?

let scanner = new ZXingScannerComponent();

scanner.hasPermission check

zxing-js 2fngx-scanner 1

scanner.hasDevices over check

zxing-js 2fngx-scanner enumeratedevices

State meanings

Below we have something I call qubool (quantum booleans), because they're booleans with multiple values, more than 0 and 1, like a qubit.

scanner.hasPermission

State 😎 Description
true ✔ Permission Granted.
false ❌ Permission Denied.
undefined ❔ Not checked yet.
null ⭕ Check has failed and the state couldn't be updated.

scanner.hasDevices

State 😎 Description
true ✔ Usable devices found.
false ❌ No available devices.
undefined ❔ Not checked yet.
null ⭕ Check has failed and the state couldn't be updated.