You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using EnterZone with @ngrx/effects in order to get Angular to do change detection upon receiving data from Electron IPC. I noticed the operator immediately above .enterZone() is not executed. (Using latest rxjs v5.4.0.)
Here is my code:
import{Injectable,NgZone}from'@angular/core';import{Actions,Effect,toPayload}from'@ngrx/effects';import{Action}from'@ngrx/store';import{Observable}from'rxjs/Observable';import'@ngrx/core/add/operator/enterZone';importrxIpcfrom'rx-ipc-electron/lib/renderer';import*asplayerfrom'./player.actions';
@Injectable()exportclassPlayerEffects{
@Effect()publicopenFile$: Observable<Action>=this.actions$.ofType(player.LOAD_MEDIA_DIALOG).switchMap(()=>rxIpc.runCommand('open-media-file',null)).switchMap(files=>{if(!files){returnObservable.empty();}returnObservable.of(newplayer.SetSourceAction(files[0]));}).do(()=>console.log('THIS IS NEVER EXECUTED.')).enterZone(this.zone);constructor(privatezone: NgZone,privateactions$: Actions){}}
I believe the easiest fix is to directly fork the rxjs do operator and wrap all three subscriber callbacks in the zone.
The text was updated successfully, but these errors were encountered:
I am using EnterZone with
@ngrx/effects
in order to get Angular to do change detection upon receiving data from Electron IPC. I noticed the operator immediately above.enterZone()
is not executed. (Using latestrxjs v5.4.0
.)Here is my code:
I believe the easiest fix is to directly fork the rxjs
do
operator and wrap all three subscriber callbacks in the zone.The text was updated successfully, but these errors were encountered: