INNER CODE UNIT · TypeScript

createState

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

const createState = (): State => {
  return new State(_configuration);
};

// Track ongoing requests
let isRequestInProgress = false;
let requestQueue: ((state: Types.NetInfoState) => void)[] = [];

/**
 * Configures the library with the given configuration. Note that calling this will stop all
 * previously added listeners from being called again. It is best to call this right when your
 * application is started to avoid issues. The configuration sets up a global singleton instance.
 *
 * @param configuration The new configuration to set.
 */
export function configure(
  configuration: Partial<Types.NetInfoConfiguration>,
): void {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…