@sigx/runtime-core
v0.4.8
Published
Runtime core for SignalX
Maintainers
Readme
@sigx/runtime-core
Runtime core for SignalX. Provides the platform-agnostic component system, JSX runtime, reconciler, lifecycle hooks, dependency injection, and control flow primitives.
Install
npm install @sigx/runtime-coreUsage
import { component, signal, onMounted, onUnmounted } from '@sigx/runtime-core';
const Timer = component(() => {
const elapsed = signal(0);
let interval: number;
onMounted(() => {
interval = setInterval(() => elapsed.value++, 1000);
});
onUnmounted(() => {
clearInterval(interval);
});
return () => <span>Elapsed: {elapsed.value}s</span>;
});Key Exports
- Component —
component,getCurrentInstance,getComponentMeta - Lifecycle —
onMounted,onUnmounted,onCreated,onUpdated - JSX Runtime —
jsx,jsxs,jsxDEV,Fragment,Text,Comment - Lazy Loading —
lazy,Suspense,isLazyComponent - Async —
useAsync - Control Flow —
Show,Switch,Match - App —
defineApp - DI —
defineInjectable,defineProvide,useAppContext - Model —
createModel,createModelFromBinding,isModel - Directives —
defineDirective,isDirective - Error Handling —
ErrorBoundary - Messaging — Domain models and pub/sub messaging
Note: Most users should install
sigxinstead, which bundles this package with a DOM renderer and the reactivity system.
Documentation
Full documentation and guides are available at the SignalX repository.
