mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 10:21:52 +00:00
Eliminates boilerplate across 7 wrapper classes (GetContainerIp, GetHostInfo, GetOutboundGateway, GetServiceManifest, GetSslCertificate, GetStatus, GetSystemSmtp) by moving shared const/once/watch/onChange/ waitFor logic into an abstract Watchable<T> base class.
19 lines
474 B
TypeScript
19 lines
474 B
TypeScript
import { Effects } from '../Effects'
|
|
import { Manifest, PackageId } from '../osBindings'
|
|
import { Watchable } from './Watchable'
|
|
|
|
export class GetServiceManifest extends Watchable<Manifest> {
|
|
protected readonly label = 'GetServiceManifest'
|
|
|
|
constructor(
|
|
effects: Effects,
|
|
readonly opts: { packageId: PackageId },
|
|
) {
|
|
super(effects)
|
|
}
|
|
|
|
protected call(callback?: () => void) {
|
|
return this.effects.getServiceManifest({ ...this.opts, callback })
|
|
}
|
|
}
|