Morrys Repositories

Morrys Repositories

  • Docs
  • GitHub

›networking

wora

  • wora

caching

  • Cache Persist
  • Relay Store
  • Apollo Cache

networking

  • NetInfo
  • Detect Network

offline

  • Offline Architecture
  • Thinking Offline
  • Offline First
  • Relay Offline
  • Apollo Offline

NetInfo

@wora/netinfo

NetInfo.addEventListener

Allows you to subscribe to the connection change event. The callback function passed as a parameter will be ****executed whenever the connection information changes**

The return parameter is function to be invoked when you want to unsubscribe

NetInfo.fetch

Return a Promise with the connection information.

React

Install @wora/netinfo using yarn or npm:

yarn add @wora/netinfo
import { NetInfo } from "@wora/netinfo";

React Native (react-native-community/react-native-netinfo)

Install @wora/netinfo using yarn or npm:

yarn add @wora/netinfo react-native @react-native-community/netinfo

You then need to link the native parts of the library for the platforms you are using. The easiest way to link the library is using the CLI tool by running this command from the root of your project:

react-native link @react-native-community/netinfo

import { NetInfo } from "@wora/netinfo";
Last updated on 2020-4-18 by morrys
← Apollo CacheDetect Network →
  • React
  • React Native (react-native-community/react-native-netinfo)
Morrys Repositories
Docs
about wora
Community
User Showcase
More
GitHubStar
Follow @m0rrys
Facebook Open Source
Copyright © 2021 Lorenzo Di Giacomo