react-native-offline
Advanced tools
Comparing version 4.1.1 to 4.1.2
{ | ||
"name": "react-native-offline", | ||
"version": "4.1.1", | ||
"version": "4.1.2", | ||
"description": "Handy toolbelt to deal with offline mode in React Native applications. Cross-platform, provides a smooth redux integration.", | ||
@@ -5,0 +5,0 @@ "main": "./src/index.js", |
# react-native-offline | ||
[](#contributors) | ||
[](#contributors) | ||
[](https://circleci.com/gh/rgommezz/react-native-offline) [](https://badge.fury.io/js/react-native-offline) [](https://coveralls.io/github/rauliyohmc/react-native-offline?branch=master) | ||
@@ -686,4 +686,5 @@ []() | ||
| [<img src="https://avatars2.githubusercontent.com/u/5106466?v=4" width="100px;"/><br /><sub><b>MichaΕ PierzchaΕa</b></sub>](https://buymeacoff.ee/thymikee)<br />[π»](https://github.com/rgommezz/react-native-offline/commits?author=thymikee "Code") | [<img src="https://avatars3.githubusercontent.com/u/119142?v=4" width="100px;"/><br /><sub><b>Ian Graham</b></sub>](https://github.com/imartingraham)<br />[π»](https://github.com/rgommezz/react-native-offline/commits?author=imartingraham "Code") | [<img src="https://avatars2.githubusercontent.com/u/1244867?v=4" width="100px;"/><br /><sub><b>Petter Samuelsen</b></sub>](http://www.pettersamuelsen.com)<br />[π»](https://github.com/rgommezz/react-native-offline/commits?author=pettersamuelsen "Code") | [<img src="https://avatars1.githubusercontent.com/u/5339061?v=4" width="100px;"/><br /><sub><b>Lukas Kurucz</b></sub>](https://github.com/usrbowe)<br />[π»](https://github.com/rgommezz/react-native-offline/commits?author=usrbowe "Code") | [<img src="https://avatars1.githubusercontent.com/u/18237132?v=4" width="100px;"/><br /><sub><b>Norris Oduro</b></sub>](https://twitter.com/norris1z)<br />[π»](https://github.com/rgommezz/react-native-offline/commits?author=Norris1z "Code") | [<img src="https://avatars3.githubusercontent.com/u/43637878?v=4" width="100px;"/><br /><sub><b>Richard Tan</b></sub>](https://github.com/richardtks)<br />[π€](#ideas-richardtks "Ideas, Planning, & Feedback") | [<img src="https://avatars3.githubusercontent.com/u/17765105?v=4" width="100px;"/><br /><sub><b>Oleg Kupriianov</b></sub>](https://twitter.com/tysh_pysh)<br />[π»](https://github.com/rgommezz/react-native-offline/commits?author=Jimbomaniak "Code") | | ||
| [<img src="https://avatars1.githubusercontent.com/u/11155505?v=4" width="100px;"/><br /><sub><b>reilem</b></sub>](https://github.com/reilem)<br />[π€](#ideas-reilem "Ideas, Planning, & Feedback") | | ||
<!-- ALL-CONTRIBUTORS-LIST:END --> | ||
This project follows the [all-contributors](https://github.com/kentcdodds/all-contributors) specification. Contributions of any kind welcome! |
/* @flow */ | ||
import { find, get, isEqual } from 'lodash'; | ||
import { find, get } from 'lodash'; | ||
import { | ||
@@ -9,2 +9,3 @@ fetchOfflineMode, | ||
} from './actionCreators'; | ||
import getSimilarActionInQueue from '../utils/getSimilarActionInQueue'; | ||
import type { NetworkState } from '../types'; | ||
@@ -56,3 +57,3 @@ | ||
actionQueue.length > 0 | ||
? find(actionQueue, (a: *) => isEqual(a, action)) | ||
? getSimilarActionInQueue(action, actionQueue) | ||
: null; | ||
@@ -59,0 +60,0 @@ if (actionQueued) { |
/* @flow */ | ||
import { get, isEqual, find, without } from 'lodash'; | ||
import { get, without } from 'lodash'; | ||
import actionTypes from './actionTypes'; | ||
import getSimilarActionInQueue from '../utils/getSimilarActionInQueue'; | ||
import type { | ||
@@ -34,4 +35,5 @@ FluxAction, | ||
: actionToLookUp; | ||
const similarActionQueued = find(state.actionQueue, (action: *) => | ||
isEqual(action, actionWithMetaData), | ||
const similarActionQueued = getSimilarActionInQueue( | ||
actionWithMetaData, | ||
state.actionQueue, | ||
); | ||
@@ -56,4 +58,5 @@ | ||
): NetworkState { | ||
const similarActionQueued = find(state.actionQueue, (a: *) => | ||
isEqual(action, a), | ||
const similarActionQueued = getSimilarActionInQueue( | ||
action, | ||
state.actionQueue, | ||
); | ||
@@ -60,0 +63,0 @@ |
67689
21
997
690