react-native-storage
Advanced tools
Comparing version 0.0.15 to 0.0.16
{ | ||
"name": "react-native-storage", | ||
"version": "0.0.15", | ||
"version": "0.0.16", | ||
"description": "This is a local storage wrapper for both react-native(AsyncStorage) and browser(localStorage). ES6/babel is needed.", | ||
@@ -5,0 +5,0 @@ "main": "storage.js", |
@@ -251,2 +251,5 @@ # react-native-storage [![Build Status](https://travis-ci.org/sunnylqm/react-native-storage.svg)](https://travis-ci.org/sunnylqm/react-native-storage) [![npm version](https://badge.fury.io/js/react-native-storage.svg)](http://badge.fury.io/js/react-native-storage) | ||
#### 0.0.16 | ||
1. getBatchDataWithIds现在不会在本地数据齐全的情况下触发sync方法了 | ||
#### 0.0.15 | ||
@@ -253,0 +256,0 @@ 1. 修复promise链式调用中的bug. |
@@ -263,2 +263,5 @@ # react-native-storage [![Build Status](https://travis-ci.org/sunnylqm/react-native-storage.svg)](https://travis-ci.org/sunnylqm/react-native-storage) [![npm version](https://badge.fury.io/js/react-native-storage.svg)](http://badge.fury.io/js/react-native-storage) | ||
#### 0.0.16 | ||
1. getBatchDataWithIds now won't invoke sync if everything is ready in storage. | ||
#### 0.0.15 | ||
@@ -265,0 +268,0 @@ 1. Fix bugs in promise chain. |
/* | ||
* local storage(web/react native) wrapper | ||
* sunnylqm 2016-02-24 | ||
* version 0.0.15 | ||
* sunnylqm 2016-03-03 | ||
* version 0.0.16 | ||
*/ | ||
@@ -159,9 +159,19 @@ | ||
ids.map((id) => me.load({ key, id, syncInBackground, autoSync: false, batched: true })) | ||
).then((results) => new Promise((resolve, reject) => me.sync[key]({ | ||
id: results | ||
.filter((value) => value.syncId !== undefined) | ||
.map((value) => value.syncId), | ||
resolve, | ||
reject | ||
})).then((data) => results.map((value) => value.syncId ? data.shift() : value))) | ||
).then((results) => { | ||
return new Promise((resolve, reject) => { | ||
const ids = results.filter((value) => value.syncId !== undefined); | ||
if(!ids.length){ | ||
return resolve(); | ||
} | ||
return me.sync[key]({ | ||
id: ids.map((value) => value.syncId), | ||
resolve, | ||
reject | ||
}); | ||
}).then((data) => { | ||
return results.map(value => { | ||
return value.syncId ? data.shift() : value | ||
}); | ||
}); | ||
}) | ||
} | ||
@@ -168,0 +178,0 @@ _lookupGlobalItem(params) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
58004
1432
274