Core API Reference

July 12, 2026 ยท View on GitHub

coaction


Core API Reference

This reference is generated from the documentation-only catalog in packages/core/api-docs.ts. The catalog combines symbols from the root entry and the public subpaths; it does not imply that every listed symbol is exported from coaction.

Import Map

Import pathIntended use
coactionCompatibility entry that selects local or shared behavior from runtime options.
coaction/localTransport-free local stores and local signal/lifecycle helpers.
coaction/sharedShared authority/client stores, the JSON protocol, and reconnect behavior.
coaction/adapterExternal-store adapter contracts, snapshots, patch helpers, and reactive utilities.

Primary Entry Points

  • create: exported by coaction and coaction/shared; creates local stores, shared main stores, and shared clients.
  • create from coaction/local: documentation name for the transport-free implementation exported as create by coaction/local. createLocal is not a root-package export.
  • Store and MiddlewareStore: runtime store contracts.
  • StoreOptions and ClientStoreOptions: creation options for main/local and client stores.
  • Slice and Slices: state-factory signatures.
  • Middleware: store enhancement contract.
  • defineExternalStoreAdapter: exported by coaction/adapter; third-party whole-store adapter helper. createBinder remains available there as the compatibility name.
  • createReactiveTracker: exported by coaction/adapter; low-level signal dependency tracker for framework adapters that need render/effect invalidation without selectors.
  • wrapStore: exported by coaction/local and coaction/adapter; low-level helper used by framework bindings.
  • signal, computed, effect, effectScope, trigger, batching helpers, and introspection helpers: alien-signals primitives re-exported for advanced integrations.

Semantics Worth Reading First

  • Prefer explicit sliceMode when passing an object whose enumerable values are all functions.
  • Native immutable store writes must happen inside set(); direct this.count += 1 writes outside that update boundary are rejected.
  • Client stores mirror shared state and their methods return promises because execution happens on the main store.
  • Methods destructured from getState() keep the correct this binding.
  • Getter accessors and get(deps, selector) computed values are cached through the built-in alien-signals runtime.
  • Binder-backed integrations are whole-store adapters; slices mode is not supported for them.
  • create() should not gain more ambiguous option combinations; prefer explicit helpers or variants for future expansion.