hmr #1

Merged
SethTrowbridge merged 9 commits from hmr into master 2023-04-01 11:13:22 -04:00
2 changed files with 5 additions and 4 deletions
Showing only changes of commit 4039a8b926 - Show all commits

View File

@ -22,16 +22,18 @@ export const FileListen =(inPath:string, inHandler:()=>void)=>
};
const HMR = {
reloads:0,
registered: new Map() as Map<string, ()=>void>,
states: new Map(),
statesOld: new Map(),
wireframe: true,
wireframe: false,
onChange(key:string, value:()=>void):void
{
this.registered.set(key, value);
},
update()
{
this.reloads++;
this.registered.forEach(handler=>handler());
this.registered.clear();
this.statesOld = this.states;

View File

@ -148,12 +148,11 @@ const Index = `
ShadowDOM.append(ShadowCSS);
ShadowDOM.append(ShadowDiv);
App(ShadowDiv, Configure);
TW.observe(TW.twind(Configure, TW.cssom(ShadowCSS)), ShadowDiv);
import App from "./app.tsx";
import React from "react";
React.render(React.createElement(App), ShadowDiv);
import {render, createElement as H} from "react";
render(H(()=>H(App)), ShadowDiv);
</script>
</body>