From a6a2cb5c58bafa744994e59a5b0f153e0bfdebc7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 17 Sep 2019 23:44:01 +0100 Subject: [PATCH 1/3] Bump mixin-deep from 1.3.1 to 1.3.2 in /example (#213) Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2. - [Release notes](https://github.com/jonschlinkert/mixin-deep/releases) - [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2) Signed-off-by: dependabot[bot] --- example/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/example/yarn.lock b/example/yarn.lock index 4cdded6a..fc52768e 100644 --- a/example/yarn.lock +++ b/example/yarn.lock @@ -4828,9 +4828,9 @@ minizlib@^1.1.1: minipass "^2.2.1" mixin-deep@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.1.tgz#a49e7268dce1a0d9698e45326c5626df3543d0fe" - integrity sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ== + version "1.3.2" + resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566" + integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA== dependencies: for-in "^1.0.2" is-extendable "^1.0.1" From cd873cf413621675284907f86d6af975079ddb65 Mon Sep 17 00:00:00 2001 From: Raul Gomez Date: Tue, 17 Sep 2019 23:47:48 +0100 Subject: [PATCH 2/3] chore: removing old docs --- docs_3x.md | 641 ----------------------------------------------------- 1 file changed, 641 deletions(-) delete mode 100644 docs_3x.md diff --git a/docs_3x.md b/docs_3x.md deleted file mode 100644 index dcd1b254..00000000 --- a/docs_3x.md +++ /dev/null @@ -1,641 +0,0 @@ -# react-native-offline v3.x.x - -Docs for v3.x.x - -## Contents - -* [Installation](#installation) -* [API](#api) -* [Component Utilities](#component-utilities) -+ [`withNetworkConnectivity()`](#withnetworkconnectivity) -+ [`ConnectivityRenderer`](#connectivityrenderer) -* [Integration with Redux](#integration-with-redux) - + [`Network reducer`](#network-reducer) - + [`createNetworkMiddleware()`](#createnetworkmiddleware) - + [`Offline Queue`](#offline-queue) - * [Other Utilities](#other-utilities) - + [`checkInternetConnection`](#checkinternetconnection) - * [Miscellanea](#miscellanea) - * [FAQ](#faq) - * [Inspiration](#inspiration) - * [License](#license) - * [Contributors](#contributors) - - -## Installation -This library supports React Native v0.48 or higher. - ``` -$ yarn add react-native-offline@3.15.2 -``` - -#### Android -This library uses the `NetInfo` module from React Native underneath the hood. To request network info in Android an extra step is required, so you should add the following line to your app's `AndroidManifest.xml` as well: - - `` - -## API - -### Component Utilities -In order to render stuff conditionally with ease. They internally listen to connection changes and also provide an extra layer of reliability by ensuring there is internet access when reporting online. For that, a HEAD request is made to a remote server. - - #### `withNetworkConnectivity()` -Higher order function that returns a higher order component (HOC). - -```js -withNetworkConnectivity(config: Config): (WrappedComponent) => EnhancedComponent - -type Config = { - withRedux?: boolean = false, - timeout?: number = 3000, - pingServerUrl?: string = 'https://www.google.com/', - withExtraHeadRequest?: boolean = true, - checkConnectionInterval?: number = 0, - checkIntervalOfflineOnly?: boolean = false, - checkInBackground?: boolean = false, - httpMethod?: string = 'HEAD', -} -``` - -##### Config - `withRedux`: flag that indicates whether the HoC should be wired up to the Redux store. By default, this parameter is `false` and the HoC injects `isConnected` as a prop into `WrappedComponent`. If `true` provided, it won't act as a component utility and pass any prop down, but instead perform the needed actions to sync up with the store. See below [Redux integration](#integration-with-redux) for more details. - - `timeout`: amount of time (in ms) that the component should wait for the ping response. Defaults to 3s. - - `pingServerUrl`: remote server to ping to. It defaults to https://www.google.com/ since it's probably one the most stable servers out there, but you can provide your own if needed. - - `withExtraHeadRequest`: flag that denotes whether the extra ping check will be performed or not. Defaults to `true`. - - `checkConnectionInterval`: the interval (in ms) you want to ping the server at. The default is 0, and that means it is not going to regularly check connectivity. - - `checkIntervalOfflineOnly`: boolean who trigger the interval function only if there is no connection when set to `true`. Defaults to `false`. - - `checkInBackground`: whether or not to check connectivity when app isn't active. Default is `false`. - - `httpMethod`: usage http method to check the internet-access. Supports HEAD or OPTIONS. Default is `HEAD`. - - ##### Usage - ```js -import React from 'react'; -import { Text } from 'react-native'; -import { withNetworkConnectivity } from 'react-native-offline'; - -const YourComponent = ({ isConnected }) => ( - {isConnected ? 'Look ma, I am connected to the internet!' : 'Offline :('} -); - -export default withNetworkConnectivity()(YourComponent); -``` - -#### `ConnectivityRenderer` -React component that accepts a function as children. It allows you to decouple your parent component and your child component, managing connectivity state on behalf of the components it is composed with, without making demands on how that state is leveraged by its children. Useful for conditionally render different children based on connectivity status. `timeout`, `pingServerUrl` and `withExtraHeadRequest` can be provided through props in this case. - -##### Props -```js -type Props = { - children: (isConnected: boolean) => React$Element - timeout?: number = 3000, - pingServerUrl?: string = 'https://www.google.com/', - withExtraHeadRequest?: boolean = true, -} -``` - -##### Usage -```js -... -import { ConnectivityRenderer } from 'react-native-offline'; - -const YourComponent = () => ( - - Image Screen - - {isConnected => ( - isConnected ? ( -