Georgi Parlakov
1 min readSep 11, 2019

--

Hello and thanks for reading and reaching out.

To answer your question:

after the observable has emitted a dozen values (and completes), what will the promise resolve?

It will resolve the last emitted value.

For example:

Or :

const source = of(1,2,3).toPromise() 
source.then(x => console.log(x));
// 3

--

--

Georgi Parlakov
Georgi Parlakov

Written by Georgi Parlakov

Angular and DotNet dev. RxJs explorer. Testing proponent. A dad. Educative.io course author. https://gparlakov.github.io/

No responses yet