18 lines
340 B
JavaScript
18 lines
340 B
JavaScript
|
|
function debounce(fn, ms) {
|
|
let timer;
|
|
return _ => {
|
|
clearTimeout(timer)
|
|
timer = setTimeout(_ => {
|
|
timer = null
|
|
fn.apply(this, arguments)
|
|
}, ms)
|
|
};
|
|
};
|
|
|
|
const base = process.env.PUBLIC_URL;
|
|
|
|
const assetsPath = `${base}/assets`;
|
|
const gamesPath = `${base}`;
|
|
|
|
export { base, debounce, assetsPath, gamesPath }; |