Skip to main content
Version: 3.x.x

useAppManager


Introduction

useAppManager allows you to use information about the connection status and screen focus state. It also offers options to manipulate its global state. This hook uses the AppManager available on the Client instance.

It returns the status of isOnline and isFocused and the actions that allow you to change them.

const { isOnline, setOnline } = useAppManager(client);

setOnline(true);
const { isFocused, setFocused } = useAppManager(client);

setFocused(true);

Returns

Returned values from this hook.

const values = useAppManager(client);

{
isFocused: boolean;
isOnline: boolean;
setFocused: (isFocused: boolean) => void;
setOnline: (isOnline: boolean) => void;
}