Files
planet/frontend/src/services/situational-awareness/index.ts

19 lines
575 B
TypeScript

import type { SituationalAwarenessGateway } from './port'
import { HttpSituationalAwarenessGateway } from './http-gateway'
export * from './types'
export type { SituationalAwarenessGateway } from './port'
let singleton: SituationalAwarenessGateway | null = null
export function createSituationalAwarenessGateway(): SituationalAwarenessGateway {
return new HttpSituationalAwarenessGateway()
}
export function getSituationalAwarenessGateway(): SituationalAwarenessGateway {
if (!singleton) {
singleton = createSituationalAwarenessGateway()
}
return singleton
}