Yoltra<R extends string, S extends Record<R, any>, EM extends EventMapBase>

interface
react/src/createYoltra.tsx:32

extends YoltraHooks<R, S, EM>

The value returned by createYoltra: the created store, an optional StoreProvider (plus its raw StoreContext), and the full set of typed hooks from YoltraHooks.

Type parameters

NameTypeDescription
Rextends stringReducer name union.
Sextends Record<R, any>State record keyed by R.
EMextends EventMapBaseEvent map.

Properties

NameTypeDescription
shallowEqual(a: T, b: T) => booleanShallow object equality using Object.is per-key.
storeStoreInstance<R, S, EM>The store created by this call; the hooks default to it (no Provider needed).
StoreContextContext<StoreInstance<R, S, EM>>Raw context carrying the store — usually you only need StoreProvider.
StoreProviderFC<{ children: ReactNode; store?: StoreInstance<R, S, EM> }>Optional provider to scope a different store instance to a subtree.
useAtomicPropUseAtomicProp<R, S>Subscribes to a single dotted path (or typed accessor).
useAtomicPropsUseAtomicProps<R, S>Subscribes to several paths and derives a value from the full state.
useEmit() => Emit<EM>Returns the store's typed emit.
useEventUseEvent<EM, S>Runs a handler for a specific (channel, type) event.
useSelector(selector: (state: DeepReadonly<S>) => T, isEqual?: (a: T, b: T) => boolean) => TSubscribes to a derived value with an optional equality comparator.
useStore() => StoreInstance<R, S, EM>Reads the current store from context (falling back to the default store).