UNPKG

sea-js-ui-core

Version:

The smallest UI framework

3 lines (2 loc) 534 B
import{BehaviorSubject as t}from"rxjs";function n(t,n){function o(){const n=window.store.getState(),o=t(n,window.store.setState.bind(window.store));document.getElementById("root").innerHTML=o}window.store.setState(n),o(),window.store.subscribe(o)}window.store=new class{constructor(n={}){this.state=new t(n)}getState(){return this.state.getValue()}setState(t){const n={...this.state.getValue(),...t};this.state.next(n)}subscribe(t){return this.state.subscribe(t)}};export{n as createComponent}; //# sourceMappingURL=bundle.esm.js.map