qiao.indexeddb.js
Advanced tools
Comparing version 0.0.9 to 0.1.0
@@ -124,8 +124,8 @@ 'use strict'; | ||
* tableName | ||
* key | ||
* data | ||
*/ | ||
exports.save = function(db, tableName, data){ | ||
exports.save = function(db, tableName, key, data){ | ||
return new Promise(function(resolve, reject){ | ||
var id = data && data.id; | ||
d.getData(db, tableName, id, function(r){ | ||
d.getData(db, tableName, key, function(r){ | ||
if(r){ | ||
@@ -132,0 +132,0 @@ d.putData(db, tableName, data, function(rr){ |
{ | ||
"name": "qiao.indexeddb.js", | ||
"version": "0.0.9", | ||
"version": "0.1.0", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "indexeddb tools", |
@@ -136,6 +136,6 @@ # qiao.indexeddb.js | ||
var data = { id: 1, name: '张三', age: 24, email: 'zhangsan@example.com' }; | ||
await qdb.save(db, tableName, data); | ||
await qdb.save(db, tableName, data.id, data); | ||
data.name = '1'; | ||
await qdb.save(db, tableName, data); | ||
await qdb.save(db, tableName, data.id, data); | ||
}catch(e){ | ||
@@ -219,2 +219,3 @@ console.log(e); | ||
1. export sync | ||
2. save key | ||
@@ -221,0 +222,0 @@ ### 0.0.6.20200731 |
@@ -13,6 +13,6 @@ 'use strict'; | ||
var data = { id: 1, name: '张三', age: 24, email: 'zhangsan@example.com' }; | ||
await qdb.save(db, tableName, data); | ||
await qdb.save(db, tableName, data.id, data); | ||
data.name = '1'; | ||
await qdb.save(db, tableName, data); | ||
await qdb.save(db, tableName, data.id, data); | ||
}catch(e){ | ||
@@ -19,0 +19,0 @@ console.log(e); |
Sorry, the diff of this file is not supported yet
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
14177
255
0