UNPKG

fluxel

Version:

An ultra-lightweight, high-performance library for efficient DOM building and dynamic web UIs

11 lines (10 loc) 376 B
import BaseFluxel from "../baseReactive.js"; const Fluxel = BaseFluxel; Fluxel.createStatefulComponent = function(renderer, initialState) { return (props = {})=>{ return Fluxel.reactive(typeof initialState === "function" ? initialState(props) : initialState || {}, (state)=>{ return renderer(props, state); }); }; }; export default Fluxel;