react-native-location-view
Version:
A package to help pick user location with autocomplete and current location support. Uses react-native-maps
17 lines (15 loc) • 361 B
JavaScript
export default function debounce(callback, wait, context = this) {
let timeout = null;
let callbackArgs = null;
const later = () => {
callback.apply(context, callbackArgs);
timeout = null;
};
return function () {
if (timeout) {
clearTimeout(timeout);
}
callbackArgs = arguments;
timeout = setTimeout(later, wait);
}
}