async/await в помощь
<script>
class FakeDB {
constructor() { }
getData(data) {
return new Promise((res, rej) => setTimeout(res, 100, data))
}
}
class User extends FakeDB {
constructor() {
super()
}
getUser() {
return super.getData({ user: 'ok' })
}
}
(async function () {
let user = new User()
console.log(await user.getUser())
})()
</script>