INNER CODE UNIT · TypeScript

Promise

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

    return new Promise((resolve) => {
      requestQueue.push(resolve);
    });
  }

  isRequestInProgress = true;

  return _state._fetchCurrentState().then((result) => {
    requestQueue.forEach((resolve) => resolve(result));
    requestQueue = [];
    return result;
  }).finally(() => {
    isRequestInProgress = false;
  });
}

/**
 * Subscribe to the global singleton's connection information. The callback is called with a parameter of type

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…