API reference
Construction and registration
Section titled “Construction and registration”| Call | Return |
|---|---|
igniteCore({ source, states?, commands?, events?, effects? }) from a source entrypoint | Callable core plus get, watch, on, execute, dispose |
core(tagName, renderer) | Registered component handle with tagName and discovery reads |
core(projectionTarget) | Disposable non-DOM projection session |
Root igniteCore() | Source-free registrar only |
Root registrar (tagName, renderer) | Source-free registered component handle |
Import igniteCore from the entrypoint for your source library.
The available configuration options depend on that source.
See Sources for complete examples.
Registering a custom element requires the DOM.
You can construct and execute a source-backed core without the DOM.
Document and speech projections use non-DOM targets.
Configuration
Section titled “Configuration”| Option | Contract |
|---|---|
source | Existing source or supported isolated definition/factory; see Sources |
states(snapshot) | Optional derived object from the native snapshot; omission yields a stable empty object |
commands({ source }) | Object of functions that call the active source |
events(event) | Typed public event declarations, not runtime payload validation |
effects({ snapshot, prevSnapshot, select, emit }) | Synchronous void callback; see Events & effects |
Removed cleanup | Explicit use is rejected. See the migration note. |
Keep states and commands inline so TypeScript infers their types.
A renderer receives their values as ctx; its return value is the view.
State/command name collisions are rejected.
Host capabilities and environmental I/O are not callback inputs.
Runtime methods
Section titled “Runtime methods”| Method | Result and meaning |
|---|---|
core.get('states') | Current derived projection; legitimate isolated runtime acquisition |
core.get('schema') | Immutable minimal catalogue |
core.get('commands') | Command catalogue, not callable functions |
core.get('events') | Event catalogue, not event history |
core.watch((next, previous) => ...) | { unsubscribe() }; no initial user delivery |
core.on(name, event => ...) | { unsubscribe() }; outward occurrence, no replay |
await core.execute({ command, input? }) | { snapshot, states, events } for the command observation window |
core.dispose() | Terminal owning cleanup; registered cores included |
execute passes exactly one input argument, including undefined when omitted.
It does not spread arrays, return the command’s ordinary value, or wait for all business I/O.
Commands requiring multiple positional arguments are callable directly, not through serialized execution.
Native snapshots come from the source; there is no raw-snapshot get key or zero-argument get.
For detailed execution, error, catalogue, and disposal edge cases, see the headless method reference.
Bindings
Section titled “Bindings”const ctx = useIgnite(core) from ignite-element/react returns inferred derived states and stable callable commands.
Direct calls preserve the original return value or promise.
Definition/fresh-factory inputs provide a private runtime per hook, released automatically on unmount.
Existing-source hooks remain shared and release only their subscription.
Neither form disposes the reusable core.
Explicit headless methods retain their separate runtime for independent inputs.
See construction safety.
igniteReact(handle) from ignite-element/react/web returns a React component for the actual registered custom element.
IgniteReactRef<typeof handle> types its command ref; declared events become on<Event> callbacks receiving flat detail.
See Views for the ordinary hook path and web interop.