blazor-state
A Blazor State management library by TimeWarp.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/TimeWarpEngineering/timewarp-state with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/TimeWarpEngineering/timewarp-state'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/timewarpengineering--blazor-state)HTML
<a href="/listings/timewarpengineering--blazor-state"><img src="/api/listings/timewarpengineering--blazor-state/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
dotnet add package TimeWarp.State dotnet add package TimeWarp.State.Blazor dotnet add package TimeWarp.State.Plus dotnet add package TimeWarp.State.Telemetry
Blazor hosts call `AddTimeWarpState` and `AddTimeWarpStateBlazor`. Console hosts call `AddTimeWarpState` only. See [Migrate to 12.0.0-beta.10](documentation/migrations/migration12.0.0-beta.10.md).
Check out the latest NuGet packages on the [TimeWarp Enterprises NuGet page](https://www.nuget.org/profiles/TimeWarp.Enterprises).
* [TimeWarp.State](https://www.nuget.org/packages/TimeWarp.State/) [](https://www.nuget.org/packages/TimeWarp.State/) * [TimeWarp.State.Blazor](https://www.nuget.org/packages/TimeWarp.State.Blazor/) [](https://www.nuget.org/packages/TimeWarp.State.Blazor/) * [TimeWarp.State.Plus](https://www.nuget.org/packages/TimeWarp.State.Plus/) [](https://www.nuget.org/packages/TimeWarp.State.Plus/) * [TimeWarp.State.Telemetry](https://www.nuget.org/packages/TimeWarp.State.Telemetry/) [](https://www.nuget.org/packages/TimeWarp.State.Telemetry/)
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
readme.md · README · 145 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- [](https://github.com/TimeWarpEngineering/timewarp-state)
- [](https://github.com/TimeWarpEngineering/timewarp-state/actions)
- [](https://github.com/TimeWarpEngineering/timewarp-state)
- [](https://github.com/TimeWarpEngineering/timewarp-state/issues)
- [](https://github.com/TimeWarpEngineering/timewarp-state/issues)
- [](https://scorecard.dev/viewer/?uri=github.com/TimeWarpEngineering/timewarp-state)
- [](https://www.nuget.org/packages/TimeWarp.State/)
- [](https://www.nuget.org/packages/TimeWarp.State/)
- [](https://twitter.com/intent/tweet?url=https://github.com/TimeWarpEngineering/timewarp-state)
- [](https://dotnet.microsoft.com)
- [](https://discord.gg/7F4bS2T)
- [](https://twitter.com/intent/follow?screen_name=StevenTCramer)
- [](https://twitter.com/intent/follow?screen_name=TheFreezeTeam1)
- <img src="https://raw.githubusercontent.com/TimeWarpEngineering/timewarpengineering.github.io/refs/heads/master/images/LogoNoMarginNoShadow.svg" alt="logo" height="120" style="float: right" />
- # TimeWarp.State
- **TimeWarp.State** (previously known as Blazor-State) is a fully asynchronous state management library. The core package has no Blazor dependency, so console and other non-UI hosts can dispatch actions through the same store. Blazor components, JavaScript interop, and render subscriptions are in **TimeWarp.State.Blazor**. It handles both Reducers and Effects consistently using async Handlers.
- By utilizing the TimeWarp.Mediator pipeline, TimeWarp.State enables a flexible, middleware-driven architecture for managing state, similar to the request-processing pipeline in ASP.NET. This approach allows developers to inject custom behaviors, such as logging, validation, and caching, directly into the state management flow.
- Hosts consume **TimeWarp.Mediator 15.0.0-beta.10** (`TimeWarp.Mediator` and, on the host, `TimeWarp.Mediator.Generators`) via generated `AddGeneratedMediator<ClientPipeline>()` / named pipelines — not MediatR and not reflection `AddMediator()`. Import `TimeWarp.Mediator.Generated` (or `TimeWarpMediatorNamespace`); the extension is internal there, and implicit usings do not include it.
- In addition to the core library, we offer **[TimeWarp.State.Blazor](/source/timewarp-state-blazor)** (components, JavaScript interop, render subscriptions), **[TimeWarp.State.Plus](/source/timewarp-state-plus)** (routing, persistence, action tracking; depends on TimeWarp.State.Blazor; package id unchanged), and **[TimeWarp.State.Telemetry](/source/timewarp-state-telemetry)** (OpenTelemetry action spans for the Aspire dashboard or any OTel backend). **[TimeWarp DevTools](/documentation/topics/devtools.md)** is a dev-only Blazor inspector (`AddTimeWarpStateDevTools()`) on top of those spans. It is the action log, state tree, and diff. It is not a production dependency. The [console sample](samples/07-console/overview.md) dispatches an action without Blazor. The [persistence sample](samples/05-persistence/readme.md) shows session storage and local storage with `[PersistentState]`. The [render control sample](samples/06-render-control/readme.md) shows `ShouldRender`, parameter checks, and `RegisterRenderTrigger`. The [telemetry sample](samples/04-telemetry/overview.md) wires the DevTools app into Aspire, including the WebAssembly counter.
- ## Give a Star! :star:
- If you find this project useful, please give it a star. Thanks!
- ## Getting Started
- I recommend the [state and action handler sample](samples/00-state-action-handler) for a step-by-step guide to building a Blazor app with TimeWarp.State. The published docs are at [timewarpengineering.github.io/timewarp-state](https://timewarpengineering.github.io/timewarp-state/).
- See full [documentation](https://timewarpengineering.github.io/timewarp-state/).
- <img src="https://raw.githubusercontent.com/TimeWarpEngineering/timewarp-state/refs/heads/master/documentation/images/time-warp-state-one-way-flow.drawio.svg" alt="logo" height="400" style="" />
- ## Installation
- Requirements: consuming projects target `net11.0` and build with a .NET 11 SDK. The analyzers and source generators in the package compile against Roslyn 5.12 (`Microsoft.CodeAnalysis.CSharp` 5.12.0), so the compiler must be Roslyn 5.12 or later: .NET SDK 11.0.100 (GA) or later. .NET 11 preview and RC SDKs that bundle an older Roslyn are not supported. See [12.0.0-beta.18](documentation/release-notes/release12.0.0-beta.18.md).
- ```console
- dotnet add package TimeWarp.State
- dotnet add package TimeWarp.State.Blazor
- dotnet add package TimeWarp.State.Plus
- dotnet add package TimeWarp.State.Telemetry
- ```
- Blazor hosts call `AddTimeWarpState` and `AddTimeWarpStateBlazor`. Console hosts call `AddTimeWarpState` only. See [Migrate to 12.0.0-beta.10](documentation/migrations/migration12.0.0-beta.10.md).
- Check out the latest NuGet packages on the [TimeWarp Enterprises NuGet page](https://www.nuget.org/profiles/TimeWarp.Enterprises).
- * [TimeWarp.State](https://www.nuget.org/packages/TimeWarp.State/) [](https://www.nuget.org/packages/TimeWarp.State/)
- * [TimeWarp.State.Blazor](https://www.nuget.org/packages/TimeWarp.State.Blazor/) [](https://www.nuget.org/packages/TimeWarp.State.Blazor/)
- * [TimeWarp.State.Plus](https://www.nuget.org/packages/TimeWarp.State.Plus/) [](https://www.nuget.org/packages/TimeWarp.State.Plus/)
- * [TimeWarp.State.Telemetry](https://www.nuget.org/packages/TimeWarp.State.Telemetry/) [](https://www.nuget.org/packages/TimeWarp.State.Telemetry/)
- ## Writing an action
- An action lives in a nested `*ActionSet` inside the state it changes. The recommended shape marks the `Action` with `[Reducer]` and declares one static `Reduce` method. The source generator writes the handler:
- ```csharp
- public sealed partial class CounterState : State<CounterState>
- {
- public int Count { get; private set; }
- public override void Initialize() => Count = 0;
- public static partial class IncrementCountActionSet
- {
- [Reducer]
- public sealed class Action(int amount) : IAction
- {
- public int Amount { get; } = amount;
- }
- private static void Reduce(CounterState state, Action action) => state.Count += action.Amount;
- }
- }
- await CounterState.IncrementCount(amount: 5); // generated dispatch method
- ```
- Write the `Handler : StateActionHandler<Action>` yourself instead when the action does async work, needs injected services, or does more than change the state synchronously. That long shape keeps working, and one state can mix both. See [Actions](documentation/topics/actions.md).
- ## JavaScript dispatch
- JavaScript can dispatch actions with `timeWarpState.DispatchRequest(name, request)`. It is opt-in: allow each action explicitly, everything else is rejected.
- ```csharp
- builder.Services.AddJavaScriptDispatch(b => b.Allow<CounterState.IncrementCountActionSet.Action>());
- ```
- See [Enable JavaScript interop](documentation/topics/enable-javascript-interop.md).
- ## Action catalog
- Mark user-facing actions with `[CatalogAction]` to enumerate and execute them at runtime, for example from a Ctrl-K command palette or as agent tools:
- ```csharp
- public static class AddPasskeyActionSet
- {
- [CatalogAction(Description = "Add a passkey to the signed-in account.", Permissions = ["credentials.write"])]
- public sealed class Action : IAction
- {
- public Action(string label) { Label = label; }
- public string Label { get; }
- }
- }
- ```
- ```csharp
- builder.Services.AddActionCatalog(typeof(AssemblyMarker).Assembly);
- ActionCatalogEntry entry = actionCatalog.Find("Credentials.AddPasskey")!;
- await entry.Execute(store, ["Laptop"]);
- ```
- The source generator emits a per-assembly registry with name, description, permissions, visibility, parameters and input schema, plus a reflection-free `Execute`. It is opt-in: unmarked actions are never cataloged. Permissions are opaque ids that the consumer enforces; `[TrackAction]` (busy indicator) is unrelated. See [Action catalog](documentation/topics/action-catalog.md).
- ## Releases
- View the [Release Notes](https://timewarpengineering.github.io/timewarp-state/ReleaseNotes/Release11.0.0.html) for detailed information on each release.
- ## Unlicense
- [](https://unlicense.org)
- This project is licensed under the [Unlicense](https://unlicense.org).
- ## Contributing
- Your contributions are welcome! Before starting any work, please open a [discussion](https://github.com/TimeWarpEngineering/timewarp-state/discussions).
- Help with the [documentation](https://timewarpengineering.github.io/timewarp-state/) is also greatly appreciated.
- ## Contact
- If you have an issue and don't receive a timely response, feel free to reach out on our [Discord server](https://discord.gg/A55JARGKKP).
- [](https://discord.gg/7F4bS2T)
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.