hmr #1
@ -22,16 +22,18 @@ export const FileListen =(inPath:string, inHandler:()=>void)=>
|
|||||||
};
|
};
|
||||||
|
|
||||||
const HMR = {
|
const HMR = {
|
||||||
|
reloads:0,
|
||||||
registered: new Map() as Map<string, ()=>void>,
|
registered: new Map() as Map<string, ()=>void>,
|
||||||
states: new Map(),
|
states: new Map(),
|
||||||
statesOld: new Map(),
|
statesOld: new Map(),
|
||||||
wireframe: true,
|
wireframe: false,
|
||||||
onChange(key:string, value:()=>void):void
|
onChange(key:string, value:()=>void):void
|
||||||
{
|
{
|
||||||
this.registered.set(key, value);
|
this.registered.set(key, value);
|
||||||
},
|
},
|
||||||
update()
|
update()
|
||||||
{
|
{
|
||||||
|
this.reloads++;
|
||||||
this.registered.forEach(handler=>handler());
|
this.registered.forEach(handler=>handler());
|
||||||
this.registered.clear();
|
this.registered.clear();
|
||||||
this.statesOld = this.states;
|
this.statesOld = this.states;
|
||||||
|
@ -148,12 +148,11 @@ const Index = `
|
|||||||
ShadowDOM.append(ShadowCSS);
|
ShadowDOM.append(ShadowCSS);
|
||||||
ShadowDOM.append(ShadowDiv);
|
ShadowDOM.append(ShadowDiv);
|
||||||
|
|
||||||
App(ShadowDiv, Configure);
|
|
||||||
TW.observe(TW.twind(Configure, TW.cssom(ShadowCSS)), ShadowDiv);
|
TW.observe(TW.twind(Configure, TW.cssom(ShadowCSS)), ShadowDiv);
|
||||||
|
|
||||||
import App from "./app.tsx";
|
import App from "./app.tsx";
|
||||||
import React from "react";
|
import {render, createElement as H} from "react";
|
||||||
React.render(React.createElement(App), ShadowDiv);
|
render(H(()=>H(App)), ShadowDiv);
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
|
Loading…
Reference in New Issue
Block a user