mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-26 18:31: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.
15 lines
352 B
TypeScript
15 lines
352 B
TypeScript
import { Effects } from '../Effects'
|
|
import { Watchable } from './Watchable'
|
|
|
|
export class GetOutboundGateway extends Watchable<string> {
|
|
protected readonly label = 'GetOutboundGateway'
|
|
|
|
constructor(effects: Effects) {
|
|
super(effects)
|
|
}
|
|
|
|
protected call(callback?: () => void) {
|
|
return this.effects.getOutboundGateway({ callback })
|
|
}
|
|
}
|