@@ -102,12 +102,12 @@ export function keepUnstableUntilFirst<T>(obs$: Observable<T>): Observable<T> {
102102 * is still alive.
103103 */
104104export function ɵkeepUnstableUntilFirstFactory (
105- _schedulers : ɵAngularFireSchedulers
105+ schedulers : ɵAngularFireSchedulers
106106) {
107107 return function keepUnstableUntilFirst < T > (
108108 obs$ : Observable < T >
109109 ) : Observable < T > {
110- return obs$ . pipe ( pendingUntilEvent ( getSchedulers ( ) . injector ) ) ;
110+ return obs$ . pipe ( pendingUntilEvent ( schedulers . injector ) ) ;
111111 }
112112}
113113
@@ -117,7 +117,7 @@ const zoneWrapFn = (
117117) => {
118118 return ( ...args : any [ ] ) => {
119119 if ( taskDone ) {
120- setTimeout ( taskDone , 10 ) ;
120+ setTimeout ( taskDone , 0 ) ;
121121 }
122122 return run ( ( ) => it . apply ( this , args ) ) ;
123123 } ;
@@ -152,7 +152,12 @@ export const ɵzoneWrap = <T= unknown>(it: T, blockUntilFirst: boolean): T => {
152152 }
153153 }
154154 if ( ret instanceof Observable ) {
155- return ret . pipe ( keepUnstableUntilFirst ) as any ;
155+ const schedulers = getSchedulers ( ) ;
156+ return ret . pipe (
157+ subscribeOn ( schedulers . outsideAngular ) ,
158+ observeOn ( schedulers . insideAngular ) ,
159+ keepUnstableUntilFirst ,
160+ ) ;
156161 } else if ( ret instanceof Promise ) {
157162 // eslint-disable-next-line @typescript-eslint/no-misused-promises
158163 return run (
@@ -168,7 +173,7 @@ export const ɵzoneWrap = <T= unknown>(it: T, blockUntilFirst: boolean): T => {
168173 // Handle unsubscribe
169174 // function() is needed for the arguments object
170175 return function ( ) {
171- setTimeout ( taskDone , 10 ) ;
176+ setTimeout ( taskDone , 0 ) ;
172177 return ret . apply ( this , arguments ) ;
173178 } ;
174179 } else {
0 commit comments