Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
DropdownHolder Example #2
type AlertType = 'info' | 'warn' | 'error' | 'success'
export type DropdownType = {
alertWithType: (type: AlertType, title: string, message: string) => void
export class DropDownHolder {
static dropDown: DropdownType
static setDropDown(dropDown: DropdownType) {
this.dropDown = dropDown
static alert(type: AlertType, title: string, message: string) {
this.dropDown.alertWithType(type, title, message)
// ...
// then call
DropDownHolder.alert('error', 'Title', 'error message')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment