yach.nim.util
Advanced tools
Comparing version 0.1.3 to 0.2.0-beta
@@ -0,0 +0,0 @@ // yach.util.data |
@@ -0,0 +0,0 @@ /** |
@@ -10,4 +10,4 @@ // elk | ||
// qiao | ||
import * as q from "qiao.ls.js"; | ||
import _yachDB from 'yach.util.indexeddb'; | ||
const yachDB = _yachDB('team'); | ||
@@ -61,8 +61,14 @@ // get user | ||
// get team | ||
let __getTeamTimes = 0; | ||
export function getTeam(id) { | ||
return new Promise(function (resolve, reject) { | ||
// var team = q.cache('cache.info.team', id); | ||
// if(team) return resolve(team); | ||
let startTime = Date.now(); | ||
const tag = __getTeamTimes++; | ||
let startTime = Date.now(); | ||
return new Promise(async function (resolve, reject) { | ||
console.time(`===getTeamTime${tag}:${id}`); | ||
const team = await yachDB.getItem(id) | ||
if(team) { | ||
console.timeEnd(`===getTeamTime${tag}:${id}`); | ||
return resolve(team); | ||
} | ||
window.nim.getTeam({ | ||
@@ -72,6 +78,6 @@ teamId: id, | ||
elk("window.nim.getTeam", startTime); | ||
console.warn(`===getTeamTime${tag}:${id}没走自定义缓存`) | ||
console.timeEnd(`===getTeamTime${tag}:${id}`); | ||
if (err) return reject(err); | ||
// q.cache('cache.info.team', id, obj); | ||
yachDB.setItem(id, obj); //更新下缓存 | ||
return resolve(obj); | ||
@@ -78,0 +84,0 @@ }, |
{ | ||
"name": "yach.nim.util", | ||
"version": "0.1.3", | ||
"version": "0.2.0-beta", | ||
"license": "MIT", | ||
@@ -11,4 +11,5 @@ "description": "yach nim: util", | ||
"qiao.ls.js": "0.0.8", | ||
"yach.util.data": "0.0.5" | ||
"yach.util.data": "0.0.5", | ||
"yach.util.indexeddb": "^0.0.1" | ||
} | ||
} |
@@ -0,0 +0,0 @@ # yach.nim.util |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
897
33472
3
1
+ Addedyach.util.indexeddb@^0.0.1
+ Addeddexie@3.2.7(transitive)
+ Addedyach.util.indexeddb@0.0.1(transitive)