perf[utils]: optimizate variable name

This commit is contained in:
Pan
2019-02-19 10:24:22 +08:00
parent 070a3343f2
commit fe950801c9
5 changed files with 23 additions and 25 deletions

View File

@@ -239,7 +239,7 @@ export function debounce(func, wait, immediate) {
// 据上一次触发时间间隔
const last = +new Date() - timestamp
// 上次被包装函数被调用时间间隔last小于设定时间间隔wait
// 上次被包装函数被调用时间间隔 last 小于设定时间间隔 wait
if (last < wait && last > 0) {
timeout = setTimeout(later, wait - last)
} else {
@@ -290,3 +290,9 @@ export function deepClone(source) {
export function uniqueArr(arr) {
return Array.from(new Set(arr))
}
export function createUniqueString() {
const timestamp = +new Date() + ''
const randomNum = parseInt((1 + Math.random()) * 65536) + ''
return (+(randomNum + timestamp)).toString(32)
}