From 67ed6552b831df66713bac9e672738796128d33f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 23 Jun 2020 14:10:17 +0200 Subject: Reorganize client shared modules --- client/src/app/shared/rxjs/zone.ts | 40 -------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 client/src/app/shared/rxjs/zone.ts (limited to 'client/src/app/shared/rxjs') diff --git a/client/src/app/shared/rxjs/zone.ts b/client/src/app/shared/rxjs/zone.ts deleted file mode 100644 index 74eed7032..000000000 --- a/client/src/app/shared/rxjs/zone.ts +++ /dev/null @@ -1,40 +0,0 @@ -import { SchedulerLike, Subscription } from 'rxjs' -import { NgZone } from '@angular/core' - -class LeaveZoneScheduler implements SchedulerLike { - constructor (private zone: NgZone, private scheduler: SchedulerLike) { - } - - schedule (...args: any[]): Subscription { - return this.zone.runOutsideAngular(() => - this.scheduler.schedule.apply(this.scheduler, args) - ) - } - - now (): number { - return this.scheduler.now() - } -} - -class EnterZoneScheduler implements SchedulerLike { - constructor (private zone: NgZone, private scheduler: SchedulerLike) { - } - - schedule (...args: any[]): Subscription { - return this.zone.run(() => - this.scheduler.schedule.apply(this.scheduler, args) - ) - } - - now (): number { - return this.scheduler.now() - } -} - -export function leaveZone (zone: NgZone, scheduler: SchedulerLike): SchedulerLike { - return new LeaveZoneScheduler(zone, scheduler) -} - -export function enterZone (zone: NgZone, scheduler: SchedulerLike): SchedulerLike { - return new EnterZoneScheduler(zone, scheduler) -} -- cgit v1.2.3