Create osm_data_fetcher.js

This commit is contained in:
xfarrow 2024-03-11 18:08:01 +01:00
parent 5698e702af
commit bb547e8911
1 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1,17 @@
const OsmRateLimiter = {
lastFetchTime: 0,
canFetch: function () {
return Date.now() - this.lastFetchTime >= 1000;
},
updateFetchTime: function () {
this.lastFetchTime = Date.now();
}
};
function retrieveCitiesFullName(name){
if (!OsmRateLimiter.canFetch()) {
// todo
}
}