MCPcopy Create free account
hub / github.com/ngrx/platform / emitInZone

Function emitInZone

modules/store-devtools/src/devtools.ts:224–238  ·  view source on GitHub ↗

* If the devtools extension is connected out of the Angular zone, * this operator will emit all events within the zone.

({
  ngZone,
  connectInZone,
}: ZoneConfig)

Source from the content-addressed store, hash-verified

222 * this operator will emit all events within the zone.
223 */
224function emitInZone<T>({
225 ngZone,
226 connectInZone,
227}: ZoneConfig): MonoTypeOperatorFunction<T> {
228 return (source) =>
229 connectInZone
230 ? new Observable<T>((subscriber) =>
231 source.subscribe({
232 next: (value) => ngZone.run(() => subscriber.next(value)),
233 error: (error) => ngZone.run(() => subscriber.error(error)),
234 complete: () => ngZone.run(() => subscriber.complete()),
235 })
236 )
237 : source;
238}

Callers 1

constructorMethod · 0.85

Calls 5

subscribeMethod · 0.80
runMethod · 0.65
nextMethod · 0.65
errorMethod · 0.65
completeMethod · 0.65

Tested by

no test coverage detected