1.0.0 • Published 6 years ago

react-native-network-status-saga v1.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Redux Saga for Network Status

A simple redux-saga solution for Network Status using the NetInfo api of react-native. This module provides a "saga" which can then be used for modeling asynchronous behavior.

Getting Started

Installation

$ npm i react-native-network-status-saga --save

Basic Usage

In your app's main saga, import the module and Spawn/fork it.

import networkStatusSaga from "react-native-network-status-saga";
    
...
yield spawn(networkStatusSaga);

Advanced Usage

Using your custom action name

yield spawn(networkStatusSaga, {
  syncAction: 'CONNECTION_STATUS'
});

Using delay by either action or interval

yield spawn(networkStatusSaga, {
  delayByInterval: 10 * 60,
  delayByAction: "APP_STARTED"
});

Properties

PropDefaultTypeDescription
syncActionCONNECTION_STATUSstringCustom action name to sync the network change values
delayByInterval0numberCustom Delay Interval (in seconds))
delayByActionnullstringCustom Delay Action

Contribution

Questions

Feel free to contact me or create an issue