import { h } from "../../src/h" ; import { createProjector } from "../../src/projector" ; import { windowPerformanceProjectorLogger } from "../../src/utilities/window-performance-projector-logger" ; document . addEventListener ( "DOMContentLoaded" , ( ) => { let name = "" ; let nameInput = ( evt ) => { name = ( evt . target as HTMLInputElement ) . value ; } ; let render = ( ) => { return h ( "body" , [ h ( "p.input" , [ h ( "span" , [ "What is your name? " ] ) , h ( "input" , { type : "text" , autofocus : true , value : name , oninput : nameInput , } ) , ] ) , name ? [ h ( "p.output" , [ `Hello ${ name }!` ] ) ] : [ ] , ] ) ; } ; createProjector ( { performanceLogger : windowPerformanceProjectorLogger , } ) . merge ( document . body , render ) ; } ) ;