Skip to content
Back to search

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.

Checked today

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
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/timewarpengineering--blazor-state/badge.svg)](/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

i

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/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/) * [TimeWarp.State.Blazor](https://www.nuget.org/packages/TimeWarp.State.Blazor/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State.Blazor?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State.Blazor/) * [TimeWarp.State.Plus](https://www.nuget.org/packages/TimeWarp.State.Plus/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State.Plus?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State.Plus/) * [TimeWarp.State.Telemetry](https://www.nuget.org/packages/TimeWarp.State.Telemetry/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State.Telemetry?logo=nuget)](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.

  1. [![Stars](https://img.shields.io/github/stars/TimeWarpEngineering/timewarp-state?logo=github)](https://github.com/TimeWarpEngineering/timewarp-state)
  2. [![workflow](https://github.com/TimeWarpEngineering/timewarp-state/actions/workflows/workflow.yml/badge.svg)](https://github.com/TimeWarpEngineering/timewarp-state/actions)
  3. [![Forks](https://img.shields.io/github/forks/TimeWarpEngineering/timewarp-state)](https://github.com/TimeWarpEngineering/timewarp-state)
  4. [![License](https://img.shields.io/github/license/TimeWarpEngineering/timewarp-state.svg?style=flat-square&logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)
  5. [![Issues Open](https://img.shields.io/github/issues/TimeWarpEngineering/timewarp-state.svg?logo=github)](https://github.com/TimeWarpEngineering/timewarp-state/issues)
  6. [![OpenSSF Scorecard](https://api.scorecard.dev/projects/github.com/TimeWarpEngineering/timewarp-state/badge)](https://scorecard.dev/viewer/?uri=github.com/TimeWarpEngineering/timewarp-state)
  7. [![nuget](https://img.shields.io/nuget/v/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
  8. [![nuget](https://img.shields.io/nuget/dt/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
  9. [![Twitter](https://img.shields.io/twitter/url?style=social&url=https%3A%2F%2Fgithub.com%2FTimeWarpEngineering%2Ftimewarp-state)](https://twitter.com/intent/tweet?url=https://github.com/TimeWarpEngineering/timewarp-state)
  10. [![Dotnet](https://img.shields.io/badge/dotnet-11.0-blue)](https://dotnet.microsoft.com)
  11. [![Discord](https://img.shields.io/discord/715274085940199487?logo=discord)](https://discord.gg/7F4bS2T)
  12. [![Twitter](https://img.shields.io/twitter/follow/StevenTCramer.svg)](https://twitter.com/intent/follow?screen_name=StevenTCramer)
  13. [![Twitter](https://img.shields.io/twitter/follow/TheFreezeTeam1.svg)](https://twitter.com/intent/follow?screen_name=TheFreezeTeam1)
  14. <img src="https://raw.githubusercontent.com/TimeWarpEngineering/timewarpengineering.github.io/refs/heads/master/images/LogoNoMarginNoShadow.svg" alt="logo" height="120" style="float: right" />
  15. # TimeWarp.State
  16. **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.
  17. 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.
  18. 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.
  19. 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.
  20. ## Give a Star! :star:
  21. If you find this project useful, please give it a star. Thanks!
  22. ## Getting Started
  23. 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/).
  24. See full [documentation](https://timewarpengineering.github.io/timewarp-state/).
  25. <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="" />
  26. ## Installation
  27. 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).
  28. ```console
  29. dotnet add package TimeWarp.State
  30. dotnet add package TimeWarp.State.Blazor
  31. dotnet add package TimeWarp.State.Plus
  32. dotnet add package TimeWarp.State.Telemetry
  33. ```
  34. 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).
  35. Check out the latest NuGet packages on the [TimeWarp Enterprises NuGet page](https://www.nuget.org/profiles/TimeWarp.Enterprises).
  36. * [TimeWarp.State](https://www.nuget.org/packages/TimeWarp.State/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State/)
  37. * [TimeWarp.State.Blazor](https://www.nuget.org/packages/TimeWarp.State.Blazor/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State.Blazor?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State.Blazor/)
  38. * [TimeWarp.State.Plus](https://www.nuget.org/packages/TimeWarp.State.Plus/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State.Plus?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State.Plus/)
  39. * [TimeWarp.State.Telemetry](https://www.nuget.org/packages/TimeWarp.State.Telemetry/) [![nuget](https://img.shields.io/nuget/v/TimeWarp.State.Telemetry?logo=nuget)](https://www.nuget.org/packages/TimeWarp.State.Telemetry/)
  40. ## Writing an action
  41. 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:
  42. ```csharp
  43. public sealed partial class CounterState : State<CounterState>
  44. {
  45. public int Count { get; private set; }
  46. public override void Initialize() => Count = 0;
  47. public static partial class IncrementCountActionSet
  48. {
  49. [Reducer]
  50. public sealed class Action(int amount) : IAction
  51. {
  52. public int Amount { get; } = amount;
  53. }
  54. private static void Reduce(CounterState state, Action action) => state.Count += action.Amount;
  55. }
  56. }
  57. await CounterState.IncrementCount(amount: 5); // generated dispatch method
  58. ```
  59. 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).
  60. ## JavaScript dispatch
  61. JavaScript can dispatch actions with `timeWarpState.DispatchRequest(name, request)`. It is opt-in: allow each action explicitly, everything else is rejected.
  62. ```csharp
  63. builder.Services.AddJavaScriptDispatch(b => b.Allow<CounterState.IncrementCountActionSet.Action>());
  64. ```
  65. See [Enable JavaScript interop](documentation/topics/enable-javascript-interop.md).
  66. ## Action catalog
  67. 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:
  68. ```csharp
  69. public static class AddPasskeyActionSet
  70. {
  71. [CatalogAction(Description = "Add a passkey to the signed-in account.", Permissions = ["credentials.write"])]
  72. public sealed class Action : IAction
  73. {
  74. public Action(string label) { Label = label; }
  75. public string Label { get; }
  76. }
  77. }
  78. ```
  79. ```csharp
  80. builder.Services.AddActionCatalog(typeof(AssemblyMarker).Assembly);
  81. ActionCatalogEntry entry = actionCatalog.Find("Credentials.AddPasskey")!;
  82. await entry.Execute(store, ["Laptop"]);
  83. ```
  84. 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).
  85. ## Releases
  86. View the [Release Notes](https://timewarpengineering.github.io/timewarp-state/ReleaseNotes/Release11.0.0.html) for detailed information on each release.
  87. ## Unlicense
  88. [![License](https://img.shields.io/github/license/TimeWarpEngineering/timewarp-state.svg?style=flat-square&logo=github)](https://unlicense.org)
  89. This project is licensed under the [Unlicense](https://unlicense.org).
  90. ## Contributing
  91. Your contributions are welcome! Before starting any work, please open a [discussion](https://github.com/TimeWarpEngineering/timewarp-state/discussions).
  92. Help with the [documentation](https://timewarpengineering.github.io/timewarp-state/) is also greatly appreciated.
  93. ## Contact
  94. 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).
  95. [![Discord](https://img.shields.io/discord/715274085940199487?logo=discord)](https://discord.gg/7F4bS2T)

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.