import { start } from "@thi.ng/hdom/start" ; const timer = ( period , name = `${ period }ms` ) => { return < any > { init ( ) { this . inited = true ; this . val = 0 ; } , render ( ) { const t = Date . now ( ) ; return ! this . inited || t % period < 16 ? [ "div.sans-serif" , `${ name } @ ${ this . val ++ || 0 }` ] : [ "div" , { __skip : true } , "I should be never seen" ] ; } , } ; } ; const app = < any > { init ( ) { this . timers = [ [ timer ( 1000 ) ] , [ timer ( 500 ) ] , [ timer ( 250 ) ] ] ; } , render ( ) { return [ "div.ma3.sans-serif" , [ "h1" , "Selective component updates" ] , this . timers , [ "a.db.mt3.link" , { href : "https://github.com/thi-ng/umbrella/tree/develop/examples/hdom-skip" , } , "Source code" , ] , ] ; } , } ; start ( [ app ] ) ;