fix DI errors when using TimeService
This commit is contained in:
parent
239cc3de6d
commit
411df0c0bf
2 changed files with 8 additions and 8 deletions
|
|
@ -10,9 +10,12 @@ import { bindThis } from '@/decorators.js';
|
|||
* Provides abstractions to access the current time.
|
||||
* Exists for unit testing purposes, so that tests can "simulate" any given time for consistency.
|
||||
*/
|
||||
@Injectable()
|
||||
export abstract class TimeService<TTimer extends Timer = Timer> implements OnApplicationShutdown {
|
||||
protected readonly timers = new Map<symbol, TTimer>();
|
||||
|
||||
protected constructor() {}
|
||||
|
||||
/**
|
||||
* Returns Date.now()
|
||||
*/
|
||||
|
|
@ -91,6 +94,10 @@ export class NativeTimeService extends TimeService<NativeTimer> implements OnApp
|
|||
return Date.now();
|
||||
}
|
||||
|
||||
public constructor() {
|
||||
super();
|
||||
}
|
||||
|
||||
protected startNativeTimer(timerId: symbol, repeating: boolean, callback: () => void, delay: number): NativeTimer {
|
||||
// Wrap the caller's callback to make sure we clean up the registration.
|
||||
const wrappedCallback = () => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue