Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-native-storage

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-storage - npm Package Compare versions

Comparing version 0.0.7 to 0.0.8

2

package.json
{
"name": "react-native-storage",
"version": "0.0.7",
"version": "0.0.8",
"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",

@@ -13,2 +13,7 @@ # react-native-storage

## Usage 使用说明
### Config 配置
You need to use [babel](https://babeljs.io/) to enable es6 modules for web development(I'll provide an example in the next version). For React-Native development, put this [babel config file](https://github.com/brentvatne/react-native-animated-demo-tinder/blob/master/.babelrc) under your project directory.
对于Web开发你需要使用[babel](https://babeljs.io/)来支持es6模块导入功能。(我会在下个版本中提供一个示例) 如果是React-Native开发,把这个[babel配置文件](https://github.com/brentvatne/react-native-animated-demo-tinder/blob/master/.babelrc)放到你的项目根目录中即可。
### Import 导入

@@ -15,0 +20,0 @@ var Storage = require('react-native-storage');

/*
* local storage(web/react native) wrapper
* sunnylqm 2015-08-24
* version 0.0.7
* sunnylqm 2015-09-01
* version 0.0.8
*/

@@ -151,3 +151,3 @@ let cache = {};

ret = JSON.parse(ret);
if(ret && ret.expires < new Date().getTime()){
if(ret.expires < new Date().getTime()){
Storage.sync[id] && Storage.sync[id]();

@@ -179,5 +179,12 @@ }

ret = JSON.parse(ret);
if(autoSync && ret && ret.expires < new Date().getTime()
&& kv.length > 1 && Storage.sync[kv[0]]){
Storage.sync[kv[0]](kv[1]);
if(ret.expires < new Date().getTime()){
if(autoSync && kv.length > 1 && Storage.sync[kv[0]]) {
Storage.sync[kv[0]](kv[1]);
}
else{
resolve({
syncId: kv[1]
});
return;
}
}

@@ -184,0 +191,0 @@ resolve(ret.rawData);

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc