Skip to content

Adapters overview

@input-actions/core ships a built-in SimpleStore that’s enough for most apps. When you want the surrounding tooling of a specific community store — devtools, persistence, observability, undo/redo — install one of the adapter packages. The StoreProvider, useStore, useActions, and bindings APIs are identical across all of them.

Every adapter implements the same Store<T> interface:

interface Store<T> {
getState(): T;
dispatch(action: Action): void;
subscribe(listener: (state: T) => void): () => void;
}

Components don’t change when you swap backends. The action vocabulary is the contract.

An adapter’s dispatch applies sync actions only. Async (action/async*) and machine (machine/*) actions are run by the executor inside StoreProvider and useLocalActions. Every adapter warns and ignores one sent straight to store.dispatch, so dispatch those through useDispatch or useActions.

When to reach for the built-in SimpleStore

Section titled “When to reach for the built-in SimpleStore”
import { createSimpleStore } from '@input-actions/core';
const store = createSimpleStore({ count: 0 });

Zero extra deps, synchronous construction, structural sharing on dispatch. Good default for new projects; covers everything the rest of this site demonstrates. Reach for an adapter only when its surrounding ecosystem buys you something.

Every adapter statically imports its peer library, so construction is synchronous and works at module scope or during SSR:

const store = createXStoreSync(initialState);

The async createXStore and ensureXLoaded from earlier releases are still exported for back-compat. They resolve immediately.

  • <StoreProvider store={store}> + useStore, useActions, useDispatch, useExecuteActions, useBoundActions, useStateMachine, useAsyncOperation(s).
  • Every action variant — sync, async (all five concurrency strategies), state-machine, bindings.
  • The applyAction reducer (ADR 0015) — all adapters commit sync actions through the same pure function. Adding a new sync action type updates one file; every adapter inherits it.

Each adapter page below covers:

  1. Install + setup — the minimum to get a store running.
  2. Unique benefit — what this adapter brings that the others don’t.
  3. Native tooling that’s still available — DevTools, persistence, undo/redo, observability — and how to reach for it through the adapter’s escape hatch.