UNPKG

@roots/bud-client

Version:

Client scripts for @roots/bud

17 lines (16 loc) 553 B
import * as Indicator from './indicator/index.js'; import * as Overlay from './overlay/index.js'; export const make = async (options) => { if (options.indicator && !customElements.get(`bud-activity-indicator`)) { maybePushController(Indicator.make()); } if (options.overlay && !customElements.get(`bud-error`)) { maybePushController(Overlay.make()); } return window.bud.controllers; }; const maybePushController = (controller) => { if (!controller) return; window.bud.controllers.push(controller); };