# Bit.Blex public API 80 public types across 3 packages. Call `GetBlexApi(typeName: "...")` for one of them in full - its parameters, properties, methods or enum values, with the default value each one really has. ## Bit.Blex - **BitBlex** (Static class) - DI helpers for registering Blex and its stores. - **BitBlexBlazor** (Static class) - Blazor-specific DI helpers for wiring Blex persistence to browser storage. - **BlexActionArg** (Struct) - A named action argument captured at dispatch time. - **BlexActionAttribute** (Attribute) - Marks a method whose name starts with On as an action implementation. - **BlexActionContext** (Class) - Context passed to middleware after an action has mutated a store. - **BlexActionDescriptor** (Class) - One action of a store, described as data: its name, its parameters, how to read its payload back out of a dispatched action and how to dispatch it. - **BlexActionErrorContext** (Class) - Context describing an action whose body threw. - **BlexAction** (Class) - A typed descriptor for a parameterless action of TStore, generated into the store's nested Actions class (CounterStore.Actions.Increment). - **BlexAction** (Class) - A typed descriptor for an action of TStore that takes arguments, generated into the store's nested Actions class (CounterStore.Actions.Add). - **BlexBrowserStorage** (Class) - IBlexStorage backed by the browser's localStorage/sessionStorage via a tiny JS bridge. - **BlexBrowserStorageKind** (Enum) - Which Web Storage area a BlexBrowserStorage instance targets. - **BlexComparers** (Static class) - Equality comparers for selector subscriptions whose projection is a collection. - **BlexComponentBase** (Component) - Optional base component that re-renders automatically when subscribed stores change. - **BlexComponentStatePersistence** (Class) - Bridges Blex stores to Blazor's PersistentComponentState so that state produced during prerendering is handed to the interactive render without re-fetching, eliminating the "double render" flicker. - **BlexComputedAttribute** (Attribute) - Marks a parameterless method (named ComputeXxx or GetXxx) as derived/computed state. - **BlexDelegateMiddleware** (Class) - A simple middleware that forwards each applied action to a delegate. - **BlexDiagnostics** (Static class) - Blex's tracing and metrics, through the standard ActivitySource and Meter APIs: subscribe with OpenTelemetry (.AddSource(BlexDiagnostics.SourceName), .AddMeter(BlexDiagnostics.SourceName)), dotnet-counters or any ActivityListener/MeterListener. - **BlexEffectAttribute** (Attribute) - Marks an asynchronous method (returning Task or ValueTask, named OnXxx) as an effect: an async action whose loading/error lifecycle is managed for you. - **BlexEffectConcurrency** (Enum) - How overlapping invocations of the same BlexEffectAttribute are handled, mirroring the RxJS flattening operators used by NgRx effects. - **BlexEntityAdapter** (Class) - Generates CRUD operations and an initial state for a normalized BlexEntityState. - **BlexEntityState** (Class) - An immutable, normalized collection: an ordered list of ids plus an id-keyed entity map. - **BlexError** (Struct) - Describes a non-fatal failure that Blex isolated from the dispatch pipeline (a throwing subscriber, middleware, persistence write, restore, sanitizer, ...). - **BlexFetchStatus** (Enum) - Whether a fetch is running, independently of BlexQueryStatus. - **BlexFilterMiddleware** (Class) - A middleware that can veto actions before they run. - **BlexHistory** (Class) - In-app undo/redo for the whole application state, independent of the Redux DevTools extension. - **BlexHistory** (Class) - Undo/redo for the stores of one type only -- an editor's undo stack that never reverts the session, the theme or a cart. - **BlexInfiniteData** (Class) - The data of an BlexInfiniteQuery: the pages loaded so far, in order, and the page param each was fetched with. - **BlexInfiniteQuery** (Class) - An observer of a paged query -- a feed, "load more", infinite scroll: the pages loaded so far, whether there is another, and BlexInfiniteQuery.FetchNextPageAsync to load it (TanStack Query's useInfiniteQuery, forward only). - **BlexJson** (Static class) - The shared JsonSerializerOptions used by generated snapshot code, persistence and the DevTools bridge. - **BlexLoggingMiddleware** (Class) - Writes actions and their failures to an ILogger (category Bit.Blex). - **BlexManager** (Class) - The central state manager. - **BlexMutationOptions** (Record) - Callbacks, optimistic updates and cache invalidation around a BlexMutation. - **BlexMutationStatus** (Enum) - How a mutation's latest call went. - **BlexMutation** (Class) - A change sent to the server, with the status of its latest call and the cache updates around it. - **BlexNetworkMode** (Enum) - Whether fetches and mutations wait for the network while the app is offline. - **BlexObservableExtensions** (Static class) - IObservable views over stores and the manager, for code that composes change streams with Reactive Extensions (System.Reactive, ReactiveUI) rather than callbacks. - **BlexOptimisticUpdate** (Class) - An optimistic update of one cached query (BlexQueryClient.Optimistic), and the way back from it. - **BlexOptions** (Class) - Configuration for the Blex manager, populated via AddBitBlexServices. - **BlexPersistenceOptions** (Class) - Configuration for BlexStatePersistor. - **BlexPreActionContext** (Class) - Context passed to middleware before an action mutates a store. - **BlexProvider** (Component) - Root component that wires every registered IBlexStore into the BlexManager manager and (on first render) connects the Redux DevTools bridge. - **BlexQuery** (Class) - An observer of one cached query: what a component reads -- the status, the error, whether a fetch is running -- whatever the data's type. - **BlexQueryClient** (Class) - A cache of server state -- data the app shows but does not own: fetched, kept while it is fresh, shared by every component that asks for the same key, refetched in the background when it goes stale, invalidated after a change, and dropped once nobody has looked at it for a while. - **BlexQueryClientOptions** (Class) - The defaults every query of a BlexQueryClient starts from. - **BlexQueryInfo** (Record) - A cached query as BlexQueryClient.GetQueries reports it, for inspection and diagnostics. - **BlexQueryKey** (Class) - Identifies a query in the BlexQueryClient cache: an ordered list of parts, from the general to the specific -- ["todos"], ["todos", 42], ["todos", "list", filter]. - **BlexQueryOptions** (Record) - How one observer of a query wants it fetched. - **BlexQueryStatus** (Enum) - Whether a query has data, has failed, or has neither yet. - **BlexQueryView** (Component) - Renders a cached query from markup: its data once there is some, a loading state before, the error when it failed -- re-rendering itself, and nothing around it, as the query changes. - **BlexQuery** (Class) - An observer of one cached query with data of type T. - **BlexReduxDevToolsConnector** (Class) - Bridges a BlexManager to the Redux DevTools browser extension, enabling live action inspection and time-travel. - **BlexRendererDispatcher** (Class) - A Blazor renderer's BlexRendererDispatcher.Dispatcher as the IBlexDispatcher a manager keeps to. - **BlexRollback** (Static class) - Builds and combines IBlexRollbacks. - **BlexScope** (Component) - Gives the content its own instance of TStore for as long as the scope is on screen: created from DI when the scope appears, registered with the manager under "{name}:{key}", cascaded to every descendant, and unregistered and disposed when the scope goes away. - **BlexSelectorFamily** (Class) - One memoized selector per argument -- the line with id 42, the total of one category, the page a list shows -- created on first use and evicted least recently used once more than BlexSelectorFamily.MaxSize arguments are held. - **BlexSelector** (Class) - A memoized derived value over the whole application state -- what [BlexComputedAttribute] is to a single store, lifted to the manager. - **BlexSelect** (Component) - Renders its content from a projection of a store, and re-renders that content -- and nothing else -- when the projection changes. - **BlexStateAttribute** (Attribute) - Marks a backing field as a piece of reactive state. - **BlexStatePersistor** (Class) - Coordinates automatic persistence: rehydrates persistent stores on startup and saves their slice through an IBlexStorage after every action (optionally debounced). - **BlexStoreAttribute** (Attribute) - Marks a partial class as a Blex state store. - **BlexStoreBase** (Class) - Base class for all Blex stores. - **BlexStoreScope** (Class) - One instance of a store that exists more than once -- a dialog's form, an editor tab, a row's detail panel -- registered with the manager under its own name for as long as the scope lives. - **BlexStoreSubscriptionExtensions** (Static class) - Selector-based subscription helpers. - **BlexView** (Component) - Re-renders its content whenever one of the given stores changes -- BlexComponentBase's Subscribe(store) as markup, for a component that cannot inherit it (it already has a base class) or that only wants part of its output to follow a store. - **IBlexDevTools** (Interface) - Abstraction over a DevTools sink. - **IBlexDispatcher** (Interface) - The execution context a manager's state belongs to -- in Blazor, the renderer's Dispatcher, which serializes everything a circuit or a BlazorWebView does. - **IBlexExternalStorageChange** (Interface) - Implemented by an IBlexStorage that can tell Blex when a key was changed by something outside this application instance -- most commonly another browser tab writing to the same localStorage. - **IBlexMiddleware** (Interface) - A pipeline hook invoked for every dispatched action. - **IBlexRollback** (Interface) - Something a failed mutation undoes: an optimistic cache update, or any change of your own. - **IBlexStateProtector** (Interface) - Protects persisted state on its way to and from storage: encryption, and the tamper check that comes with it. - **IBlexStorage** (Interface) - Storage-agnostic, asynchronous key/value sink used to persist store state. - **IBlexStorageSuspension** (Interface) - Implemented by an IBlexStorage that lives on a page which can go away without the application being disposed -- a browser tab that is closed, reloaded, navigated away from or discarded in the background. - **IBlexStore** (Interface) - A reactive state container. ## Bit.Blex.Maui - **BitBlexMaui** (Static class) - DI helpers for wiring Blex into a .NET MAUI application. - **BlexPreferencesStorage** (Class) - IBlexStorage backed by .NET MAUI IPreferences, so persisted store state lives in the OS-native app preferences (SharedPreferences on Android, NSUserDefaults on iOS/Mac Catalyst, the local settings store on Windows). ## Bit.Blex.Testing - **BlexActionLog** (Class) - Records every action dispatched through a BlexManager for assertions in tests. - **BlexRecordedAction** (Record) - A single recorded action and the state snapshot taken immediately after it. - **BlexTestExtensions** (Static class) - Convenience extensions for testing Blex stores and managers. - **BlexTestHarness** (Static class) - Factory helpers for BlexTestHarness. - **BlexTestHarness** (Class) - A self-contained test fixture around a single store: it creates a BlexManager, registers the store, and records every action so tests can assert on dispatch behavior without any Blazor or DI setup.