@kvaser/canking-api
Version:
CanKing API to communicate with the CanKing service using Node.js.
28 lines (16 loc) • 590 B
Markdown
[**Kvaser CanKing GUI Extensions SDK v7.5.1**](../../README.md)
***
[Kvaser CanKing GUI Extensions SDK](../../modules.md) / [hooks](../README.md) / useDevicesState
# Function: useDevicesState()
> **useDevicesState**(): [`IDevicesContext`](../interfaces/IDevicesContext.md)
A hook for hardware devices.
## Returns
[`IDevicesContext`](../interfaces/IDevicesContext.md)
The devices state.
## Example
```
const { devices, isLoaded, error } = useDevicesState();
if (!isLoaded) return <Loading />;
if (error) return <ErrorView error={error} />;
// devices value is now safe to use
```