const getPlayerName = (sessions, color) => { for (let i = 0; i < sessions.length; i++) { const session = sessions[i]; if (session.color === color) { return session.name; } } return null; } 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, getPlayerName };