AppManager
App manager handles main application states - focus and online. Those two values can answer questions:
- Is the tab or current view instance focused and visible for user?
- Is our application online or offline? With the app manager it is not a problem to get the valid answer for this question.
Import
import { AppManager } from "@hyper-fetch/core"
Source
Package
Parameters
class AppManager {
constructor(options: AppManagerOptionsType) {};
options: AppManagerOptionsType;
isOnline: boolean;
isFocused: boolean;
isBrowser: boolean;
events: { emitBlur: () => void; emitFocus: () => void; emitOffline: () => void; emitOnline: () => void; onBlur: (callback: () => void) => VoidFunction; onFocus: (callback: () => void) => VoidFunction; onOffline: (callback: () => void) => VoidFunction; onOnline: (callback: () => void) => VoidFunction };
emitter: EventEmitter;
initialize() => void;
setFocused(isFocused: boolean) => void;
setOnline(isOnline: boolean) => void;
}
Parameters
| Name | Type | Description |
|---|---|---|
| options | |
Properties
events
Source
Type
{ emitBlur: () => void; emitFocus: () => void; emitOffline: () => void; emitOnline: () => void; onBlur: (callback: () => void) => VoidFunction; onFocus: (callback: () => void) => VoidFunction; onOffline: (callback: () => void) => VoidFunction; onOnline: (callback: () => void) => VoidFunction }