(container: HTMLElement, selector: string, component: T)
| 57 | } |
| 58 | |
| 59 | export function mount<T extends Mountable>(container: HTMLElement, selector: string, component: T): T { |
| 60 | const placeholder = container.querySelector(selector); |
| 61 | if (!placeholder) { |
| 62 | throw new Error(`mount: placeholder '${selector}' not found in container`); |
| 63 | } |
| 64 | placeholder.replaceWith(component.root); |
| 65 | return component; |
| 66 | } |
no outgoing calls
no test coverage detected