Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
825 changes: 825 additions & 0 deletions .tags

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,15 @@
"react-native": "^0.57.8",
"react-native-testing-library": "^1.5.0",
"react-test-renderer": "^16.6.3",
"redux": "^4.0.1",
"redux-mock-store": "^1.5.3",
"redux-saga-test-plan": "4.0.0-beta.2",
"redux-thunk": "^2.3.0"
},
"dependencies": {
"lodash": "^4.17.11",
"react-redux": "^6.0.0",
"redux": "4.x",
"@react-native-community/netinfo": "~2.0.10",
"react-redux": "^5.1.1",
"redux": "~4.0",
"redux-saga": "^1.0.2"
},
"jest": {
Expand Down
3 changes: 2 additions & 1 deletion src/components/NetworkConnectivity.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */
import * as React from 'react';
import { AppState, NetInfo, Platform } from 'react-native';
import { AppState, Platform } from 'react-native';
import NetInfo from '@react-native-community/netinfo';
import type { HTTPMethod, State } from '../types';
import * as connectivityInterval from '../utils/checkConnectivityInterval';
import checkInternetAccess from '../utils/checkInternetAccess';
Expand Down
9 changes: 9 additions & 0 deletions src/components/ReduxNetworkProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,15 @@ class ReduxNetworkProvider extends React.Component<Props> {
httpMethod: DEFAULT_HTTP_METHOD,
};

shouldComponentUpdate({ isConnected }) {
const { isConnected: wasConnected } = this.props;
if (isConnected !== wasConnected) {
return false;
}

return true;
}

handleConnectivityChange = (isConnected: boolean) => {
const { isConnected: wasConnected, dispatch } = this.props;
if (isConnected !== wasConnected) {
Expand Down
3 changes: 2 additions & 1 deletion src/redux/sagas.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
/* eslint flowtype/require-parameter-type: 0 */
import { put, select, call, take, cancelled, fork } from 'redux-saga/effects';
import { eventChannel } from 'redux-saga';
import { AppState, NetInfo, Platform } from 'react-native';
import { AppState, Platform } from 'react-native';
import NetInfo from '@react-native-community/netinfo';
import { networkSelector } from './reducer';
import checkInternetAccess from '../utils/checkInternetAccess';
import { connectionChange } from './actionCreators';
Expand Down
2 changes: 1 addition & 1 deletion src/utils/checkInternetConnection.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* @flow */

import { NetInfo } from 'react-native';
import NetInfo from '@react-native-community/netinfo';
import checkInternetAccess from './checkInternetAccess';
import { DEFAULT_PING_SERVER_URL, DEFAULT_TIMEOUT } from './constants';

Expand Down
2 changes: 1 addition & 1 deletion test/checkInternetConnection.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NetInfo } from 'react-native';
import NetInfo from '@react-native-community/netinfo';
import checkInternetConnection from '../src/utils/checkInternetConnection';
import checkInternetAccess from '../src/utils/checkInternetAccess';
import {
Expand Down
2 changes: 1 addition & 1 deletion test/sagaChannels.test.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { eventChannel } from 'redux-saga';
import { NetInfo } from 'react-native';
import NetInfo from '@react-native-community/netinfo';
import {
createNetInfoConnectionChangeChannel,
netInfoEventChannelFn,
Expand Down
3 changes: 2 additions & 1 deletion test/sagas.test.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* @flow */
import { testSaga } from 'redux-saga-test-plan';
import { Platform, NetInfo, AppState } from 'react-native';
import { Platform, AppState } from 'react-native';
import NetInfo from '@react-native-community/netinfo';
import networkSaga, {
netInfoChangeSaga,
connectionIntervalSaga,
Expand Down
71 changes: 54 additions & 17 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -607,13 +607,20 @@
pirates "^4.0.0"
source-map-support "^0.5.9"

"@babel/runtime@^7.0.0", "@babel/runtime@^7.2.0":
"@babel/runtime@^7.0.0":
version "7.2.0"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.2.0.tgz#b03e42eeddf5898e00646e4c840fa07ba8dcad7f"
integrity sha512-oouEibCbHMVdZSDlJBO6bZmID/zA/G/Qx3H1d3rSNPTD+L8UNKvCat7aKWSJ74zYbm5zWGh0GQN0hKj8zYFTCg==
dependencies:
regenerator-runtime "^0.12.0"

"@babel/runtime@^7.1.2":
version "7.4.5"
resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.4.5.tgz#582bb531f5f9dc67d2fcb682979894f75e253f12"
integrity sha512-TuI4qpWZP6lGOGIuGWtp9sPluqYICmbk8T/1vpSysqJxRPkudh/ofFWyqdcMsDf2s7KvDL4/YHgKyvcS3g9CJQ==
dependencies:
regenerator-runtime "^0.13.2"

"@babel/template@^7.0.0", "@babel/template@^7.1.0", "@babel/template@^7.1.2", "@babel/template@^7.2.2":
version "7.2.2"
resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.2.2.tgz#005b3fdf0ed96e88041330379e0da9a708eb2907"
Expand Down Expand Up @@ -647,6 +654,11 @@
lodash "^4.17.10"
to-fast-properties "^2.0.0"

"@react-native-community/netinfo@~2.0.10":
version "2.0.10"
resolved "https://registry.yarnpkg.com/@react-native-community/netinfo/-/netinfo-2.0.10.tgz#d28a446352e75754b78509557988359133cdbcca"
integrity sha512-NrIzyLe0eSbhgMnHl2QdSEhaA7yXh6p9jzMomfUa//hoTXE+xbObGDdiWWSQm2bnXnZJg8XCU3AB9qzvqcuLnA==

"@redux-saga/core@^1.0.2":
version "1.0.2"
resolved "https://registry.yarnpkg.com/@redux-saga/core/-/core-1.0.2.tgz#4336a5bb4253e5ca69681c25a863fbbc03ea6d88"
Expand Down Expand Up @@ -3539,12 +3551,12 @@ hoek@2.x.x:
version "2.16.3"
resolved "https://registry.yarnpkg.com/hoek/-/hoek-2.16.3.tgz#20bb7403d3cea398e91dc4710a8ff1b8274a25ed"

hoist-non-react-statics@^3.2.1:
version "3.2.1"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.2.1.tgz#c09c0555c84b38a7ede6912b61efddafd6e75e1e"
integrity sha512-TFsu3TV3YLY+zFTZDrN8L2DTFanObwmBLpWvJs1qfUuEQ5bTAdFcwfx2T/bsCXfM9QHSLvjfP+nihEl0yvozxw==
hoist-non-react-statics@^3.1.0:
version "3.3.0"
resolved "https://registry.yarnpkg.com/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz#b09178f0122184fb95acf525daaecb4d8f45958b"
integrity sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==
dependencies:
react-is "^16.3.2"
react-is "^16.7.0"

home-or-tmp@^2.0.0:
version "2.0.0"
Expand Down Expand Up @@ -5961,6 +5973,15 @@ prop-types@^15.5.8, prop-types@^15.6.2:
loose-envify "^1.3.1"
object-assign "^4.1.1"

prop-types@^15.6.1:
version "15.7.2"
resolved "https://registry.yarnpkg.com/prop-types/-/prop-types-15.7.2.tgz#52c41e75b8c87e72b9d9360e0206b99dcbffa6c5"
integrity sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==
dependencies:
loose-envify "^1.4.0"
object-assign "^4.1.1"
react-is "^16.8.1"

pseudomap@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
Expand Down Expand Up @@ -6059,11 +6080,21 @@ react-dom@^16.6.3:
prop-types "^15.6.2"
scheduler "^0.12.0"

react-is@^16.3.2, react-is@^16.6.1, react-is@^16.6.3, react-is@^16.7.0:
react-is@^16.6.0, react-is@^16.8.1:
version "16.8.6"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.8.6.tgz#5bbc1e2d29141c9fbdfed456343fe2bc430a6a16"
integrity sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==

react-is@^16.6.1, react-is@^16.7.0:
version "16.7.0"
resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.7.0.tgz#c1bd21c64f1f1364c6f70695ec02d69392f41bfa"
integrity sha512-Z0VRQdF4NPDoI0tsXVMLkJLiwEBa+RP66g0xDHxgxysxSoCUccSten4RTF/UFvZF1dZvZ9Zu1sx+MDXwcOR34g==

react-lifecycles-compat@^3.0.0:
version "3.0.4"
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362"
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA==

react-native-testing-library@^1.5.0:
version "1.5.0"
resolved "https://registry.yarnpkg.com/react-native-testing-library/-/react-native-testing-library-1.5.0.tgz#02762bf8cb5c1295a220d5e5d40ffc2ebecf31da"
Expand Down Expand Up @@ -6136,17 +6167,18 @@ react-proxy@^1.1.7:
lodash "^4.6.1"
react-deep-force-update "^1.0.0"

react-redux@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-6.0.0.tgz#09e86eeed5febb98e9442458ad2970c8f1a173ef"
integrity sha512-EmbC3uLl60pw2VqSSkj6HpZ6jTk12RMrwXMBdYtM6niq0MdEaRq9KYCwpJflkOZj349BLGQm1MI/JO1W96kLWQ==
react-redux@^5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/react-redux/-/react-redux-5.1.1.tgz#88e368682c7fa80e34e055cd7ac56f5936b0f52f"
integrity sha512-LE7Ned+cv5qe7tMV5BPYkGQ5Lpg8gzgItK07c67yHvJ8t0iaD9kPFPAli/mYkiyJYrs2pJgExR2ZgsGqlrOApg==
dependencies:
"@babel/runtime" "^7.2.0"
hoist-non-react-statics "^3.2.1"
"@babel/runtime" "^7.1.2"
hoist-non-react-statics "^3.1.0"
invariant "^2.2.4"
loose-envify "^1.4.0"
prop-types "^15.6.2"
react-is "^16.6.3"
loose-envify "^1.1.0"
prop-types "^15.6.1"
react-is "^16.6.0"
react-lifecycles-compat "^3.0.0"

react-test-renderer@^16.0.0-0, react-test-renderer@^16.6.3:
version "16.7.0"
Expand Down Expand Up @@ -6281,7 +6313,7 @@ redux-thunk@^2.3.0:
resolved "https://registry.yarnpkg.com/redux-thunk/-/redux-thunk-2.3.0.tgz#51c2c19a185ed5187aaa9a2d08b666d0d6467622"
integrity sha512-km6dclyFnmcvxhAcrQV2AkZmPQjzPDjgVlQtR0EQjxZPyJ0BnMf3in1ryuR8A2qU0HldVRfxYXbFSKlI3N7Slw==

redux@4.x, "redux@>=0.10 <5":
"redux@>=0.10 <5", redux@~4.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/redux/-/redux-4.0.1.tgz#436cae6cc40fbe4727689d7c8fae44808f1bfef5"
integrity sha512-R7bAtSkk7nY6O/OYMVR9RiBI+XghjF9rlbl5806HJbQph0LJVHZrU5oaO4q70eUKiqMRqm4y07KLTlMZ2BlVmg==
Expand Down Expand Up @@ -6315,6 +6347,11 @@ regenerator-runtime@^0.12.0:
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz#fa1a71544764c036f8c49b13a08b2594c9f8a0de"
integrity sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg==

regenerator-runtime@^0.13.2:
version "0.13.2"
resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.2.tgz#32e59c9a6fb9b1a4aff09b4930ca2d4477343447"
integrity sha512-S/TQAZJO+D3m9xeN1WTI8dLKBBiRgXBlTJvbWjCThHWZj9EvHK70Ff50/tYj2J/fvBY6JtFVwRuazHN2E7M9BA==

regenerator-transform@^0.10.0:
version "0.10.1"
resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd"
Expand Down