Skip to content

Instantly share code, notes, and snippets.

@Lxxyx
Last active August 31, 2021 07:02
Show Gist options
  • Save Lxxyx/1114ca3e0e9b9185cba7f5e10fae0a06 to your computer and use it in GitHub Desktop.
Save Lxxyx/1114ca3e0e9b9185cba7f5e10fae0a06 to your computer and use it in GitHub Desktop.
protocol
interface ProtocolClient {}
interface ProtocolAdapter {}
interface ProtocolLifeCycle {}
interface ProtocolBuilder {
client: ProtocolClient;
adapter: ProtocolAdapter;
lifeCycle: ProtocolLifeCycle;
}
interface ProtocolAbstractBuilder {
buildClient (): void
buildFunction (): void
buildLifeCycle (): void
}
class ProtocolDirector {
build (builder: ProtocolAbstractBuilder): void {
builder.buildClient()
builder.buildFunction()
builder.buildLifeCycle()
}
}
interface TriggerAdapter {
is (): boolean
// client
// api
// lifecycle
}
interface TriggerBuilder {
setTrigger (adapter: TriggerAdapter) {}
buildApi () {}
buildClient () {}
buildLifeCycle () {}
}
interface TriggerLifeCycle {
onReady () {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment