[**Kvaser CanKing GUI Extensions SDK v7.4.0**](../../README.md)

***

[Kvaser CanKing GUI Extensions SDK](../../modules.md) / [hooks](../README.md) / useOnlineStatusSync

# Function: useOnlineStatusSync()

> **useOnlineStatusSync**(`parentIsInitialized`, `id`, `onGoingOnline`, `onGoingOffline`): `boolean`

Custom hook to synchronize session state with online/offline status changes.

## Parameters

### parentIsInitialized

`boolean`

Whether the parent component is initialized and has loaded all project and session data needed before receiving online updates.

### id

`number`

The unique id of the view. This is passed to the view component as the `id` prop.

### onGoingOnline

[`OnGoingOnlineCallback`](../type-aliases/OnGoingOnlineCallback.md)

Callback function to handle going online. Called when the CanKing starts a measurement or when the view is mounted while online.

### onGoingOffline

[`OnGoingOfflineCallback`](../type-aliases/OnGoingOfflineCallback.md)

Callback function to handle going offline. Called when the CanKing stops a measurement or when the view is mounted while offline.

## Returns

`boolean`

The current online status.
