import { useMemo, useContext } from 'preact/hooks'; import { deepSignal } from 'deepsignal'; import { component } from './hooks'; export default () => { // const Context = ( { children, data, context: { Provider } } ) => { const signals = useMemo( () => deepSignal( JSON.parse( data ) ), [ data ] ); return { children }; }; component( 'context', Context ); // const Show = ( { children, when, evaluate, context } ) => { const contextValue = useContext( context ); if ( evaluate( when, { context: contextValue } ) ) { return children; } else { return ; } }; component( 'show', Show ); };