solid-use
Version:
A collection of SolidJS utilities
2 lines (1 loc) • 632 B
JavaScript
import{Show as i,createComponent as r,createMemo as l,createSignal as s,lazy as c,onMount as u,sharedConfig as f}from"solid-js";import{isServer as m}from"solid-js/web";var o=m?()=>()=>!1:()=>{let[e,n]=s(!1);return u(()=>{n(!0)}),e},p=e=>{let n=o();return i({keyed:!1,get when(){return n()},get fallback(){return e.fallback},get children(){return e.children}})};function y(e){let n=c(e);return t=>{if(f.context){let a=o();return l(()=>{if(a())return r(n,t)})}return r(n,t)}}function g(e){return n=>{let t=o();return l(()=>{if(t())return r(e,n)})}}export{p as ClientOnly,g as clientComponent,y as clientOnly,o as createClientSignal};