await on observable

JavaScript
if (condition) {
  await observable.first().toPromise();
}
await observable.toPromise();

Source

Also in JavaScript: