refactor: application dependency management (#2363)
This commit is contained in:
@@ -4,7 +4,6 @@ import { log, removeFromArray } from '@standardnotes/utils'
|
||||
import { EventObserver } from '../Event/EventObserver'
|
||||
import { ApplicationServiceInterface } from './ApplicationServiceInterface'
|
||||
import { InternalEventBusInterface } from '../Internal/InternalEventBusInterface'
|
||||
import { ApplicationStage } from '../Application/ApplicationStage'
|
||||
import { InternalEventPublishStrategy } from '../Internal/InternalEventPublishStrategy'
|
||||
import { DiagnosticInfo } from '../Diagnostics/ServiceDiagnostics'
|
||||
|
||||
@@ -93,19 +92,14 @@ export abstract class AbstractService<EventName = string, EventData = unknown>
|
||||
return promise
|
||||
}
|
||||
|
||||
/**
|
||||
* Application instances will call this function directly when they arrive
|
||||
* at a certain migratory state.
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
public async handleApplicationStage(_stage: ApplicationStage): Promise<void> {
|
||||
// optional override
|
||||
}
|
||||
|
||||
getServiceName(): string {
|
||||
return this.constructor.name
|
||||
}
|
||||
|
||||
isApplicationService(): true {
|
||||
return true
|
||||
}
|
||||
|
||||
log(..._args: unknown[]): void {
|
||||
if (this.loggingEnabled) {
|
||||
// eslint-disable-next-line prefer-rest-params
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import { ApplicationStage } from '../Application/ApplicationStage'
|
||||
import { ServiceDiagnostics } from '../Diagnostics/ServiceDiagnostics'
|
||||
import { EventObserver } from '../Event/EventObserver'
|
||||
|
||||
@@ -7,6 +6,5 @@ export interface ApplicationServiceInterface<E, D> extends ServiceDiagnostics {
|
||||
addEventObserver(observer: EventObserver<E, D>): () => void
|
||||
blockDeinit(): Promise<void>
|
||||
deinit(): void
|
||||
handleApplicationStage(stage: ApplicationStage): Promise<void>
|
||||
log(message: string, ...args: unknown[]): void
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user