ilokesto

Package surface

The public entrypoint paths are defined by state/package.json exports. Import framework-neutral construction from the root and framework adapters from their subpaths.

Entry point matrix

ImportPurpose
@ilokesto/stateFramework-neutral Store, createStore, createReducer, pipe, definePipeableMiddleware, PipeConfigurationError, and dispose, plus their public state contracts.
@ilokesto/state/reactReact create() adapter and UseState, UseReducer types.
@ilokesto/state/vueVue create() adapter and UseState, UseReducer types.
@ilokesto/state/svelteSvelte create() adapter and UseState, UseReducer types.
@ilokesto/state/solidSolid create() adapter and UseState, UseReducer types.
@ilokesto/state/angularAngular create() adapter and AngularOptions, UseState, UseReducer types.
@ilokesto/state/middlewareRegistered middleware, store disposal, and middleware types.
@ilokesto/state/utilsThe pipe builder, custom-middleware registration, configuration errors, and pipe types.
@ilokesto/state/adaptoradaptor; requires the optional immer peer.
@ilokesto/state/package.jsonPackage metadata export for tooling that needs this package manifest.

Middleware exports

@ilokesto/state/middleware exports debounce, throttle, devtools, dispose, history, HistoryConfigurationError, logger, persist, and validate.

Its public types are HistoryControls, HistoryOptions, HistoryStore, OnRehydrateStorage, OnRehydrateStorageCallback, PersistControls, PersistDecoder, PersistDecoderStateDiagnostic, PersistMigration, PersistStore, SafePersistConfig, SafePersistCookieConfig, SafePersistLocalConfig, and SafePersistSessionConfig.

Utility exports

@ilokesto/state/utils exports pipe, definePipeableMiddleware, and PipeConfigurationError.

Its public types are Pipe, PipeAnyMiddleware, PipeBuilder, PipeCapability, PipeConfigurationErrorCode, PipeDuplicatePolicy, PipeMiddleware, PipeMiddlewareConflictDiagnostic, and PipeMiddlewareMetadata.

Root and framework entrypoints

Import framework-neutral construction APIs from the root. Framework adapter APIs such as create, bind, and bindReducer come from a framework subpath, never the root.

// Available from the framework subpath
import { create } from '@ilokesto/state/react';
import { logger } from '@ilokesto/state/middleware';

Use createStore or createReducer from the root and connect the result with bind or bindReducer from a framework subpath. See Vanilla state and binding and the migration guide.

Peer dependencies

Framework peers are optional: install only the adapter framework you use. immer is optional and only needed when you use adaptor from @ilokesto/state/adaptor.

On this page