rxjs-fake-async.ts 759 B

123456789101112131415161718192021
  1. /**
  2. * @license
  3. * Copyright Google Inc. All Rights Reserved.
  4. *
  5. * Use of this source code is governed by an MIT-style license that can be
  6. * found in the LICENSE file at https://angular.io/license
  7. */
  8. import {asapScheduler, asyncScheduler, Scheduler} from 'rxjs';
  9. Zone.__load_patch('rxjs.Scheduler.now', (global: any, Zone: ZoneType, api: _ZonePrivate) => {
  10. api.patchMethod(Scheduler, 'now', (delegate: Function) => (self: any, args: any[]) => {
  11. return Date.now.call(self);
  12. });
  13. api.patchMethod(asyncScheduler, 'now', (delegate: Function) => (self: any, args: any[]) => {
  14. return Date.now.call(self);
  15. });
  16. api.patchMethod(asapScheduler, 'now', (delegate: Function) => (self: any, args: any[]) => {
  17. return Date.now.call(self);
  18. });
  19. });