Skip to content

Instantly share code, notes, and snippets.



Last active Aug 8, 2019
What would you like to do?
A RxJS pipeable operator which let the observables to enter into angular zone so that the change detection works properly.
import { NgZone } from '@angular/core';
import { Observable } from 'rxjs/Observable';
export function enterZone(zone: NgZone) {
return <T>(source: Observable<T>) =>
new Observable<T>(observer =>
next: (x) => =>,
error: (err) => observer.error(err),
complete: () => observer.complete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment