title: .toPromise() and lastValueFrom() in rxjs
body: <p>I have this observable</p>
  <pre><code>createMyRecord(): Observable&lt;myRecord&gt; {
          return of(TEMPLATE_DB).pipe(
              mergeMap((template) =&gt; doTask(template)),
              mergeMap(() =&gt; EMPTY)
          );
      }
  </code></pre>
  <p>I call it with</p>
  <pre><code>await createMyRecord().toPromise();
  </code></pre>
  <p>.toPromise() is deprecated, so I would like to change the call with lastValueFrom():</p>
  <pre><code>await lastValueFrom(createMyRecord());
  </code></pre>
  <p>but I receive the following error:<br></p>
  <pre><code>EmptyError
  no elements in sequence
  </code></pre>
  <p>UPDATE: for now, resolved with:</p>
  <pre><code> await lastValueFrom(createMyRecord()).catch((err) =&gt; {
              if (err instanceof EmptyError) {
                  log.info(OK&quot;);
              }
          });
  </code></pre>
  <p>but is there a better solution?</p>