Hi, I’m using CapacitorPurchases plugin (but any plugin can have this situation) and methods return promises with results.
Normally i use something like
const result = await CapacitorPurchases.getPurchaserInfo();
this.ngZone.run(()=>{
// do something with result
})
now I have a situation where i prefer to use rxjs and “complex” stream pipes with switchMap and other things. If I write
from( from(CapacitorPurchases.getPurchaserInfo()))
.pipe(switchMap(value=>{
this.a = value;
return this.httpService.call()
})
the content of switchMap is runned outside ngZone context
but if I write
from( from(CapacitorPurchases.getPurchaserInfo()))
.pipe(switchMap(value=>{
this.ngZone.run(()=>{
this.a = value;
})
return this.httpService.call()
})
or other combination, i can loose data.
Do you know if there is a way to create a zone context with a stream pipe?
Thank you!