React Native Offline Versions Save

Handy toolbelt to deal nicely with offline/online connectivity in a React Native app. Smooth redux integration ✈️

v6.0.1

1 year ago

Fixes a peer dependency issue with [email protected]

v6.0.0

2 years ago

v5.8.0

3 years ago

Added useIsConnected hook

v5.7.0

3 years ago

What's new

  • Support for custom headers when pinging your own server

v5.3.0

4 years ago

TypeScript Support 🚀

Rewriting the library with Typescript + exporting types to consumers

v5.2.0

4 years ago

Offline queue semaphore

Adds a mechanism control for the offline queue, in order to decide when to release it.

For that, createNetworkMiddleware now receives a new optional parameter, shouldDequeueSelector. See more here

v5.1.0

4 years ago

This release exposes a new api, createReducer, that allows you to customise the way the offline queue handles duplicates.

v4.3.0

5 years ago

New features

createNetworkMiddleware

A new optional parameter has been added, queueReleaseThrottle. It allows you to interval the dispatches when flushing the offline queue. It defaults to 50ms.

v4.1.0

5 years ago
  • Fixes bug on iOS on checkInternetConnection
  • Added a 3rd optional parameter: shouldPing
  • Added documentation around it

v4.0.0

5 years ago

Summary

This release is a full-blown refactor of the library, where some of the core components have been re-written from scratch, providing a better modularity, using the latest React features and adopting a TDD strategy, where all the code is unit tested to facilitate external contributions in the future.

image

Added

  • Full feature parity between components and sagas
  • 100% unit test coverage in components, redux utilities and sagas

Breaking changes

Components

  • withNetworkConnectivity HOC has been replaced with NetworkProvider and NetworkConsumer components, that leverage the new React Context API.
  • The following props/config have changed:
    • timeout -> pingTimeout
    • withExtraHeadRequest -> shouldPing
    • checkConnectionInterval -> pingInterval
    • checkIntervalOfflineOnly -> pingOnlyIfOffline
    • checkInBackground -> pingInBackground
  • ConnectivityRenderer doesn't exist anymore. Use NetworkConsumer from now on.

Redux integration

Utilities

  • checkInternetConnection Function params order has been reversed. Now 1st argument is the url and 2nd the timeout.