flat: 暂存
This commit is contained in:
@@ -41,9 +41,21 @@ function deg2rad(deg) {
|
||||
return deg * (Math.PI / 180);
|
||||
}
|
||||
|
||||
export function debounce(fun, delay) {
|
||||
return function(args) {
|
||||
let that = this;
|
||||
let _args = args;
|
||||
clearTimeout(fun.id);
|
||||
fun.id = setTimeout(() => {
|
||||
fun.call(that, _args)
|
||||
}, delay)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
export default {
|
||||
onDialingPhoneNumber,
|
||||
addZeroPrefix,
|
||||
getDistanceFromLatLonInKm
|
||||
getDistanceFromLatLonInKm,
|
||||
debounce
|
||||
}
|
||||
Reference in New Issue
Block a user