class LocationService { async redirect(to, delay = 0) { return new Promise(res => { setTimeout(() => { window.location = to res() }, delay) }) } async back() { return window.history.back() } async reload(delay = 0) { return new Promise(res => { setTimeout(() => { window.location.reload() res() }, delay) }) } } const location_service = new LocationService() export { location_service }