INNER CODE UNIT · TypeScript

fetch

react-native-netinfo/react-native-netinfo · src/index.ts:63

export function fetch(
  requestedInterface?: string,
): Promise<Types.NetInfoState> {
  if (!_state) {
    _state = createState();
  }
  return _state.latest(requestedInterface);
}

/**
 * Force-refreshes the internal state of the global singleton managed by this library.
 *
 * @returns A Promise which contains the updated connection state.
 */
export function refresh(): Promise<Types.NetInfoState> {
  if (!_state) {
    _state = createState();
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…