We want to synchronous access to the value streamed by our Observable
.
Approach
Turn the Observable
into a Promise
and await it like this:
async function syncAccess() {
const value:boolean = await of(true).toPromise();
console.log(value)
}