# Migrating from Fluxor

This guide takes a Blazor app from Fluxor 6.11.0 (`Fluxor` and `Fluxor.Blazor.Web`, the latest release as of 2026-11-08) to Ducky 2.0. The two libraries share the Redux model: a feature state becomes a slice, a reducer method becomes an `On<TAction>` in that slice, an effect method becomes an `Effect<TAction>`. What changes is mostly around the edges: how the store is registered and started, what an effect can do about concurrency, and what a dispatch tells you.

Ducky 2.0 targets `net11.0` only, and it is a pre-release. Fluxor 6.11.0 targets `net8.0`, `net9.0` and `net10.0` and has years of production use. If your app can't move to .NET 11 yet, stay on Fluxor. [How Ducky compares](../compare.md) sets the two side by side.

Every snippet on this page comes from the compiled sample in `docs/migration/samples/fluxor`. `Before` is user code against `Fluxor.Blazor.Web` 6.11.0 from nuget.org, written from Fluxor's own [tutorials](https://github.com/mrpmorris/Fluxor/tree/6.11.0/Source/Tutorials/02-Blazor). `After` is the same app on Ducky 2.0, and `After.Tests` holds its tests and one test per behaviour change below.

## Checklist

1. Target `net11.0`. Replace `Fluxor` and `Fluxor.Blazor.Web` with `Ducky` and `Ducky.Blazor`, and add `Ducky.Testing` to test projects. Remove `Fluxor.Blazor.Web.ReduxDevTools` (DevTools ship in `Ducky.Blazor`) and the community `Fluxor.Persist` (persistence ships in `Ducky.Blazor`).
2. Make each `[FeatureState]` a plain record, and move its `[ReducerMethod]`s into the constructor of a `Slice<TState>`, one `On<TAction>` each (see [State, actions and reducers](#state-actions-and-reducers)).
3. Turn each `[EffectMethod]` into an `Effect<TAction>` that dispatches through its `context`, passes its `cancellationToken` on, and picks a `Policy` (see [Effects](#effects)).
4. Replace `FluxorComponent` with `DuckyComponent`, and each injected `IState<T>` or `IStateSelection<TState, TValue>` with a `Select` in `OnInitialized` (see [Components](#components)).
5. In `_Imports.razor` and the `.razor` files, replace `@using Fluxor` and `@using Fluxor.Blazor.Web.Components` with `@using Ducky` and `@using Ducky.Blazor`, `@inherits FluxorComponent` with `@inherits DuckyComponent`, and each `@inject IState<T>` or `@inject IStateSelection<TState, TValue>` with a `Select` in the `@code` block's `OnInitialized`; drop `@inject IDispatcher`, since the component's own `Dispatch` and `DispatchAsync` replace it.
6. Replace `AddFluxor` with `AddDucky` and the generated `AddDuckyGenerated_{Assembly}()`, register middleware with `Use<T>()`, and pass a `JsonSerializerContext` to `UseJson` (see [Registration](#registration)).
7. Delete `<StoreInitializer />`. Move the first load from `OnInitialized` to an effect on `StoreInitialized`, and register a prerendered slice with `Prerender<T>` (see [The store initializer and the first load](#the-store-initializer-and-the-first-load)).
8. Run the app's tests, then read [Behaviour changes](#behaviour-changes).

## Before and after

### State, actions and reducers

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/Before/Counter.cs#L6-L26

```csharp
// Fluxor: [FeatureState] marks the state; its parameterless constructor gives the initial state.
[FeatureState]
public sealed record CounterState(int Count, bool IsLoading, string? Error)
{
    public CounterState() : this(Count: 0, IsLoading: false, Error: null)
    {
    }
}

public sealed record IncrementCounterAction(int Amount);

public sealed record LoadCounterAction;

public sealed record LoadCounterResultAction(int Count);

public sealed record LoadCounterFailedAction(string Error);

public interface ICounterApi
{
    Task<int> GetCountAsync(CancellationToken cancellationToken);
}
```

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After/Counter.cs#L6-L20

```csharp
// Ducky 2.0: the state and the actions stay plain records; no attribute, no parameterless constructor.
public sealed record CounterState(int Count, bool IsLoading, string? Error);

public sealed record IncrementCounterAction(int Amount);

public sealed record LoadCounterAction;

public sealed record LoadCounterResultAction(int Count);

public sealed record LoadCounterFailedAction(string Error);

public interface ICounterApi
{
    Task<int> GetCountAsync(CancellationToken cancellationToken);
}
```

Actions don't change: any record is an action in both libraries. The reducers move from static `[ReducerMethod]`s, which Fluxor's scan finds anywhere in the assembly, into the slice that owns the state:

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/Before/Counter.cs#L30-L47

```csharp
// Fluxor: static [ReducerMethod]s, found by the assembly scan; [ReducerMethod(typeof(T))] when the payload is unused.
public static class CounterReducers
{
    [ReducerMethod]
    public static CounterState OnIncrement(CounterState state, IncrementCounterAction action) =>
        state with { Count = state.Count + action.Amount };

    [ReducerMethod(typeof(LoadCounterAction))]
    public static CounterState OnLoad(CounterState state) => state with { IsLoading = true, Error = null };

    [ReducerMethod]
    public static CounterState OnLoaded(CounterState state, LoadCounterResultAction action) =>
        state with { Count = action.Count, IsLoading = false };

    [ReducerMethod]
    public static CounterState OnLoadFailed(CounterState state, LoadCounterFailedAction action) =>
        state with { IsLoading = false, Error = action.Error };
}
```

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After/Counter.cs#L24-L39

```csharp
// Ducky 2.0: one slice holds the initial state and one On<TAction> per action; On<T>(state => ...) when the payload is unused.
public sealed class CounterSlice : Slice<CounterState>
{
    public CounterSlice()
    {
        On<IncrementCounterAction>((state, action) => state with { Count = state.Count + action.Amount });
        On<LoadCounterAction>(state => state with { IsLoading = true, Error = null });
        On<LoadCounterResultAction>((state, action) => state with { Count = action.Count, IsLoading = false });
        On<LoadCounterFailedAction>((state, action) => state with { IsLoading = false, Error = action.Error });
    }

    // The slice key, pinned because the prerender seed and DevTools name the slice by it.
    public override string Key => "counter";

    protected override CounterState Initial => new(Count: 0, IsLoading: false, Error: null);
}
```

Both libraries treat a reducer that returns the same reference as no change: Fluxor's `Feature<TState>` compares with [`ReferenceEquals`](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor/Feature.cs#L95), and so does Ducky (see [Slices and keys](../guides/core/slices-and-keys.md#reducers)). Fluxor's feature name becomes the slice key, derived from the class name unless you override `Key`; pin it once the slice is persisted or prerendered, as the sample does.

### Effects

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/Before/Counter.cs#L51-L66

```csharp
// Fluxor: an [EffectMethod] starts for every LoadCounterAction, alongside any earlier run, and gets no cancellation token.
public sealed class CounterEffects(ICounterApi api)
{
    [EffectMethod(typeof(LoadCounterAction))]
    public async Task HandleLoad(IDispatcher dispatcher)
    {
        try
        {
            dispatcher.Dispatch(new LoadCounterResultAction(await api.GetCountAsync(CancellationToken.None)));
        }
        catch (HttpRequestException exception)
        {
            dispatcher.Dispatch(new LoadCounterFailedAction(exception.Message));
        }
    }
}
```

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After/Counter.cs#L43-L60

```csharp
// Ducky 2.0: an Effect<TAction> gets a cancellation token and a concurrency policy. Switch: a newer LoadCounterAction
// cancels the running load, and the cancelled run can no longer dispatch.
public sealed class LoadCounterEffect(ICounterApi api) : Effect<LoadCounterAction>
{
    public override Concurrency Policy => Concurrency.Switch;

    public override async Task Handle(LoadCounterAction action, EffectContext context, CancellationToken cancellationToken)
    {
        try
        {
            context.Dispatch(new LoadCounterResultAction(await api.GetCountAsync(cancellationToken)));
        }
        catch (HttpRequestException exception)
        {
            context.Dispatch(new LoadCounterFailedAction(exception.Message));
        }
    }
}
```

The effect takes its services through its constructor, as Fluxor's instance effects do, and both libraries create one effect instance per store. What is new is the `CancellationToken`, cancelled when the run is superseded or the store is disposed, and the `Policy`: `Merge` (the default, what Fluxor always does), `Switch`, `Exhaust` or `Queue` (see [Effects and concurrency policies](../guides/core/effects.md)). Dispatch through the `context`, never through an injected `IStore`: the context knows which run dispatches, so a superseded run's late results are dropped (DUCKY008 warns on the injection).

### Middleware

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/Before/Counter.cs#L70-L79

```csharp
// Fluxor: a Middleware sees every action through BeforeDispatch and AfterDispatch.
public sealed class ActionLog
{
    public List<string> Entries { get; } = [];
}

public sealed class ActionLogMiddleware(ActionLog log) : Middleware
{
    public override void AfterDispatch(object action) => log.Entries.Add(action.GetType().Name);
}
```

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After/Counter.cs#L80-L89

```csharp
// Ducky 2.0: a Middleware sees every reduced action in AfterReduce, with its context (the action, origin, states).
public sealed class ActionLog
{
    public List<string> Entries { get; } = [];
}

public sealed class ActionLogMiddleware(ActionLog log) : Middleware
{
    public override void AfterReduce(ActionContext context) => log.Entries.Add(context.Action.GetType().Name);
}
```

Fluxor's four main [`Middleware`](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor/Middleware.cs#L21-L33) hooks map across: `MayDispatchAction` becomes `MayDispatch`, `BeforeDispatch` becomes `BeforeReduce`, `AfterDispatch` becomes `AfterReduce`, and `InitializeAsync(IDispatcher, IStore)` becomes `InitializeAsync(CancellationToken)` with the store in the `Store` property. Ducky's dispatch hooks receive an `ActionContext` (the action, its type name, origin, depth and the states before and after) and are synchronous: asynchronous work belongs in an effect. Fluxor's `AfterInitializeAllMiddlewares` and the client scripts of an `IWebMiddleware` have no counterpart.

### Components

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/Before/CounterView.cs#L11-L30

```csharp
// Fluxor: FluxorComponent finds its IState<T> properties by reflection and re-renders on every change of the feature.
public sealed class CounterView : FluxorComponent
{
    [Inject]
    private IState<CounterState> CounterState { get; set; } = null!;

    [Inject]
    private IDispatcher Dispatcher { get; set; } = null!;

    public void Increment() => Dispatcher.Dispatch(new IncrementCounterAction(1));

    protected override void OnInitialized()
    {
        base.OnInitialized(); // required: FluxorComponent subscribes here (analyzer FLXW01)
        Dispatcher.Dispatch(new LoadCounterAction()); // fire-and-forget: void, no result to await
    }

    protected override void BuildRenderTree(RenderTreeBuilder builder) =>
        builder.AddContent(0, CounterState.Value.IsLoading ? "loading" : CounterState.Value.Count.ToString(CultureInfo.InvariantCulture));
}
```

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After/CounterView.cs#L9-L23

```csharp
// Ducky 2.0: DuckyComponent re-renders only when a value it selected in OnInitialized changed; no base call to remember.
public sealed class CounterView : DuckyComponent
{
    private Selection<CounterState>? _counter;

    public void Increment() => Dispatch(new IncrementCounterAction(1));

    // Awaitable: completes once the action is reduced, with how it ended.
    public Task<DispatchResult> RefreshAsync() => DispatchAsync(new LoadCounterAction());

    protected override void OnInitialized() => _counter = Select((CounterState state) => state);

    protected override void BuildRenderTree(RenderTreeBuilder builder) =>
        builder.AddContent(0, _counter!.Value.IsLoading ? "loading" : _counter.Value.Count.ToString(CultureInfo.InvariantCulture));
}
```

`FluxorComponent` finds its `IState<T>` and `IStateSelection` members [by reflection](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor/StateSubscriber.cs#L59) when its `OnInitialized` runs, which is why an override must call `base.OnInitialized()`: Fluxor's analyzer ([FLXW01](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Docs/releases.md)) reports a missing call, and [disposal throws](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor.Blazor.Web/Components/FluxorComponent.cs#L82) otherwise. A `DuckyComponent` subscribes through the `Select` calls you make in `OnInitialized`, with no base call needed. `Select` after the first render throws (DUCKY352), and DUCKY009 catches a `Select` in markup.

`IStateSelection` maps to the same `Select`, narrowed to one value:

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/Before/CounterView.cs#L34-L47

```csharp
// Fluxor: an injected IStateSelection narrows the re-renders to one selected value.
public sealed class LoadingBadge : FluxorComponent
{
    [Inject]
    private IStateSelection<CounterState, bool> IsLoading { get; set; } = null!;

    protected override void OnInitialized()
    {
        IsLoading.Select(state => state.IsLoading);
        base.OnInitialized();
    }

    protected override void BuildRenderTree(RenderTreeBuilder builder) => builder.AddContent(0, IsLoading.Value ? "busy" : "idle");
}
```

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After/CounterView.cs#L27-L36

```csharp
// Ducky 2.0: Select replaces the injected IStateSelection; the component re-renders when IsLoading changes, not on every
// change of the slice.
public sealed class LoadingBadge : DuckyComponent
{
    private Selection<bool>? _isLoading;

    protected override void OnInitialized() => _isLoading = Select((CounterState state) => state.IsLoading);

    protected override void BuildRenderTree(RenderTreeBuilder builder) => builder.AddContent(0, _isLoading!.Value ? "busy" : "idle");
}
```

For a selector shared by several components, or one combining slices, use `Selector.Define` (see [Selectors](../guides/core/selectors.md)); Fluxor has no memoized selector type.

### The store initializer and the first load

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/Before/CounterView.cs#L51-L64

```csharp
// Fluxor: <Fluxor.Blazor.Web.StoreInitializer /> above the <Router> (in Routes.razor or App.razor) starts the store
// in its OnAfterRenderAsync. This is the same markup written in C#.
public sealed class Routes : ComponentBase
{
    [Parameter]
    public RenderFragment? ChildContent { get; set; }

    protected override void BuildRenderTree(RenderTreeBuilder builder)
    {
        builder.OpenComponent<StoreInitializer>(0);
        builder.CloseComponent();
        builder.AddContent(1, ChildContent);
    }
}
```

Fluxor's `StoreInitializer` starts the store in [`OnAfterRenderAsync`](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor.Blazor.Web/StoreInitializer.cs#L78-L88), and until then dispatched actions [wait in a queue](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor/Store.cs#L163-L164). Ducky needs no initializer: the store initializes on its first use (a dispatch, a `Select`, a `State` read). Delete the component. `<DuckyInitializer>` exists for the cases its guides name: a static SSR page that must show Server-storage values ([Static SSR](../guides/blazor/static-ssr.md)), or a WebAssembly app with a persistence `Scope` and no Ducky component ([Persistence](../guides/blazor/persistence.md#scopes)).

The Fluxor component dispatched the first `LoadCounterAction` from `OnInitialized`. On a prerendered page that runs twice, once in the prerender pass and once interactively. In Ducky the first load is an effect on `StoreInitialized` that returns early when the slice was restored, the [load rule](../guides/blazor/render-modes.md#one-load-rule-in-every-mode):

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After/Counter.cs#L64-L76

```csharp
// Ducky 2.0: the first load runs once the store is initialized, unless the prerender seed already restored the slice.
public sealed class LoadCounterOnStart : Effect<StoreInitialized>
{
    public override Task Handle(StoreInitialized action, EffectContext context, CancellationToken cancellationToken)
    {
        if (!context.State.WasRestored<CounterState>())
        {
            context.Dispatch(new LoadCounterAction());
        }

        return Task.CompletedTask;
    }
}
```

### Registration

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/Before/Registration.cs#L11-L17

```csharp
// Fluxor: the reflection scan finds the feature, reducers and effects; middleware is added by hand. In a Blazor Web
// App this runs in both Program.cs files.
services.AddSingleton(api);
services.AddSingleton<ActionLog>();
services.AddFluxor(options => options
    .ScanAssemblies(typeof(Registration).Assembly)
    .AddMiddleware<ActionLogMiddleware>());
```

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After/Registration.cs#L13-L21

```csharp
// Ducky 2.0: the generated AddDuckyGenerated_{Assembly}() replaces the reflection scan (slices and effects);
// middleware is added with Use<T>(). Prerender<T> carries the prerendered slice into the interactive store.
services.AddSingleton(api);
services.AddSingleton<ActionLog>();
services.AddDucky(ducky => ducky
    .AddDuckyGenerated_FluxorSample_After()
    .UseJson(AppJson.Default)
    .Use<ActionLogMiddleware>()
    .Prerender<CounterSlice, CounterState>(static state => state is { IsLoading: false, Error: null }));
```

`AddDuckyGenerated_{Assembly}()` is generated at build time for each assembly that declares slices or effects (see [Getting started](../guides/core/getting-started.md#register)); a class library that declares slices has its own. In a Blazor Web App, call `AddDucky` in both `Program.cs` files, as Fluxor's tutorial asks for `AddFluxor`. Ducky serializes through the `JsonSerializerContext` you pass to `UseJson`, never by reflection: the prerender seed, persistence and DevTools need it, and DUCKY006 lists the types it lacks:

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After/AppJson.cs#L6-L12

```csharp
// Ducky 2.0 never serializes by reflection: the prerender seed, persistence and DevTools go through this context.
[JsonSerializable(typeof(CounterState))]
[JsonSerializable(typeof(IncrementCounterAction))]
[JsonSerializable(typeof(LoadCounterAction))]
[JsonSerializable(typeof(LoadCounterResultAction))]
[JsonSerializable(typeof(LoadCounterFailedAction))]
public sealed partial class AppJson : JsonSerializerContext;
```

## Mapping table

Fluxor column: Fluxor 6.11.0, as of 2026-11-08.

| Fluxor 6.11 | Ducky 2.0 |
|---|---|
| `Fluxor`, `Fluxor.Blazor.Web` (`net8.0`, `net9.0`, `net10.0`) | `Ducky`, `Ducky.Blazor` (`net11.0`) |
| `services.AddFluxor(o => o.ScanAssemblies(asm))` | `services.AddDucky(d => d.AddDuckyGenerated_{Assembly}())`, generated at build time |
| `o.ScanTypes(...)` | `d.AddSlice<TSlice>()`, `d.AddEffect<TEffect>()` |
| `o.AddMiddleware<T>()` | `d.Use<T>()` |
| `o.WithLifetime(StoreLifetime.Scoped / Singleton)` | `d.Lifetime`; by default a singleton in the browser and scoped on the server |
| `<Fluxor.Blazor.Web.StoreInitializer />` | nothing: the store initializes on first use; `<DuckyInitializer>` is optional |
| `StoreInitializer.UnhandledException` | an effect on `EffectFailed` or `ReducerFailed` |
| `[FeatureState]` record with a parameterless constructor, or `Feature<TState>` with `GetInitialState()` | a plain record and a `Slice<TState>` with `protected override TState Initial` |
| `[FeatureState(Name = "...")]`, `Feature.GetName()` | the slice `Key`, derived from the class name or overridden |
| `[ReducerMethod] static TState M(TState, TAction)` | `On<TAction>((state, action) => ...)` in the slice constructor |
| `[ReducerMethod(typeof(TAction))] static TState M(TState)` | `On<TAction>(state => ...)` |
| `Reducer<TState, TAction>` | `On<TAction>` in the slice |
| `[EffectMethod] Task M(TAction, IDispatcher)`, `[EffectMethod(typeof(TAction))]` | `Effect<TAction>.Handle(action, EffectContext, CancellationToken)`; several actions in one class: `EffectGroup` |
| `Effect<TTriggerAction>.HandleAsync(action, dispatcher)` | `Effect<TAction>.Handle(action, context, cancellationToken)` |
| a `CancellationToken` shared by hand between effect methods | `Policy => Concurrency.Switch` (or `Exhaust`, `Queue`) and the run's token |
| `IDispatcher.Dispatch(action)` (returns `void`) | `Dispatch(action)`, or `await DispatchAsync(action)` for a `DispatchResult` once reduced |
| `IState<TState>`, `@inject IState<T>` + `FluxorComponent` | `DuckyComponent` + `Select(...)` in `OnInitialized`, or `DuckyComponent<TState>` |
| `IStateSelection<TState, TValue>.Select(selector, valueEquals, selectedValueChanged)` | `Select(selector, comparer)` on a component; `store.Select(selector, onChange, comparer)` elsewhere |
| `FluxorLayout` | `DuckyLayout` |
| `MaximumStateChangedNotificationsPerSecond` | no equivalent: a component re-renders only when a value it selected changed |
| `SubscribeToAction<TAction>(callback)`, `IActionSubscriber` | no component-level action subscription: put the reaction in an `Effect<TAction>`, or select the state the action changes |
| `Middleware`: `InitializeAsync`, `MayDispatchAction`, `BeforeDispatch`, `AfterDispatch` | `Middleware`: `InitializeAsync`, `MayDispatch`, `BeforeReduce`, `AfterReduce` |
| `o.UseRouting()`, `GoAction` | no router state: use `NavigationManager` |
| `Fluxor.Blazor.Web.ReduxDevTools`, `o.UseReduxDevTools(...)` | `d.UseDevTools(...)` in `Ducky.Blazor`, guarded by `IsDevelopment()` ([Redux DevTools](../guides/blazor/devtools.md)) |
| community [`Fluxor.Persist`](https://github.com/Tailslide/fluxor-persist) (`net8.0`, `net9.0`): `UsePersist`, `IStringStateStorage` | `d.Persist<TSlice>(...)` or `[Persist]`: `localStorage`, `sessionStorage` or `IDistributedCache` ([Persistence](../guides/blazor/persistence.md)) |
| no multi-tab sync | `Persist<TSlice>(o => o.SyncAcrossTabs = true)` ([Cross-tab sync](../guides/blazor/cross-tab.md)) |
| no prerender state transfer in a release ([#547](https://github.com/mrpmorris/Fluxor/issues/547)) | `d.Prerender<TSlice>()` ([Prerender](../guides/blazor/prerender.md)) |
| static reducers called directly; `Effect<T>.HandleAsync` with a mocked `IDispatcher` | `SliceTest`, `EffectTest`, `TestStore` in `Ducky.Testing` ([Testing](../guides/core/testing.md)) |

## Behaviour changes

Each comes with the test that pins it.

### The store works during prerender and static SSR

Fluxor's `StoreInitializer` initializes the store in `OnAfterRenderAsync`, which a prerender pass or a static SSR page never reaches, so with it no released version reduces actions or runs effects there; the workaround reported in [#547](https://github.com/mrpmorris/Fluxor/issues/547), calling [`IStore.InitializeAsync()`](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor/IStore.cs#L78) from a component, breaks JavaScript middleware such as Redux DevTools. #547 was closed as completed on 2026-09-03, but as of 2026-11-08 no release contains the change: 6.11.0, of 2026-08-03, is the latest, and the work sits on the unreleased branch `547/PeteM-SSR`. A Ducky store initializes on its first use, rendered or not:

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After.Tests/BehaviourChangeTests.cs#L98-L113

```csharp
[Fact]
public async Task Store_InitializesOnFirstUse_WithoutAnInitializerComponent()
{
    var api = new FakeCounterApi();
    await using var provider = Registration.AddApp(new ServiceCollection(), api).BuildServiceProvider();
    var store = provider.GetRequiredService<IStore>();

    // No component has rendered: the first dispatch initializes the store, then the action is reduced.
    var result = await store.DispatchAsync(new IncrementCounterAction(1));

    result.ShouldBe(DispatchResult.Reduced);
    store.State.Get<CounterState>().Count.ShouldBe(1);
    await api.Called(0); // and StoreInitialized started the first load
    api.Complete(0, 0); // let the load finish before disposal
    await store.WhenIdleAsync(Xunit.TestContext.Current.CancellationToken);
}
```

With `Prerender<T>`, the prerender pass waits until its store is idle, writes the slice into the page's persisted component state, and the interactive store starts from it. The slice reads as restored, so the load rule doesn't load it a second time ([Prerender](../guides/blazor/prerender.md)):

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After.Tests/BehaviourChangeTests.cs#L81-L94

```csharp
[Fact]
public async Task RestoredSlice_IsNotLoadedAgain()
{
    var api = new FakeCounterApi();
    await using var store = TestStore.Create(
        ducky => ducky.AddSlice<CounterSlice>().AddEffect<LoadCounterOnStart>().AddEffect<LoadCounterEffect>(),
        services => services.AddSingleton<ICounterApi>(api));

    store.Seed(new CounterState(Count: 12, IsLoading: false, Error: null)); // as the prerender seed restores it
    await store.Settled();

    api.Calls.ShouldBe(0);
    store.State.Get<CounterState>().Count.ShouldBe(12);
}
```

The full prerender-to-interactive handoff is pinned in Ducky's own suite (`Prerender_RestoredSlice_LoadEffectRunsOnceAcrossHandoff` in `test/Ducky.Blazor.Tests/Prerender/PrerenderHandoffTests.cs`).

### Effects have a concurrency policy and a cancellation token

Fluxor starts every matching effect for every action and [awaits them together in the background](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor/Store.cs#L188-L236), with no cancellation token: two quick loads both run to the end, and the one that answers last wins, whatever the order they were dispatched in. A Ducky effect with `Switch` cancels the running load and drops its late result:

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After.Tests/BehaviourChangeTests.cs#L42-L59

```csharp
[Fact]
public async Task SwitchEffect_NewerLoad_CancelsAndDropsTheOlderRun()
{
    var api = new FakeCounterApi(honourCancellation: false); // an API that ignores the token and answers late
    await using var store = TestStore.Create(
        ducky => ducky.AddSlice<CounterSlice>().AddEffect<LoadCounterEffect>(),
        services => services.AddSingleton<ICounterApi>(api));

    store.Dispatch(new LoadCounterAction());
    store.Dispatch(new LoadCounterAction()); // Fluxor would run both loads to completion
    api.Token(0).IsCancellationRequested.ShouldBeTrue();

    api.Complete(1, 5);
    api.Complete(0, 99); // the superseded run answers late: its dispatch is dropped
    await store.Settled();

    store.State.Get<CounterState>().Count.ShouldBe(5);
}
```

Keep the default `Merge` where every run must complete, as in Fluxor.

### Dispatch returns a DispatchResult

Fluxor's [`IDispatcher.Dispatch`](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor/IDispatcher.cs#L16) returns `void`, and no release has a `DispatchAsync` (the work on [#322](https://github.com/mrpmorris/Fluxor/issues/322) is unreleased). Ducky's `Dispatch` also returns `void`; `await DispatchAsync(...)` completes once the action is reduced, before its effects finish, with `Reduced`, `Vetoed`, `Dropped`, `Failed` or `Disposed`. The task never faults: a reducer failure is the `Failed` result and a `ReducerFailed` action (see the [threading contract](../threading.md)). To also wait for effects, use `WhenIdleAsync()`.

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After.Tests/BehaviourChangeTests.cs#L29-L38

```csharp
[Fact]
public async Task DispatchAsync_CompletesOnceReduced_WithItsResult()
{
    await using var store = TestStore.Create(ducky => ducky.AddSlice<CounterSlice>());

    var result = await store.DispatchAsync(new IncrementCounterAction(2)); // Fluxor's Dispatch returns void

    result.ShouldBe(DispatchResult.Reduced);
    store.State.Get<CounterState>().Count.ShouldBe(2); // read-your-writes, before any effect finished
}
```

### Handlers match the exact action type

Fluxor matches a reducer or an effect with [`action is TAction`](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor/DependencyInjection/Wrappers/ReducerWrapper.cs#L12), so a handler of a base action also runs for every derived action. Ducky matches the exact type only ([ADR-0008](https://github.com/phmatray/Ducky/blob/v2/docs/adr/0008-exact-type-handler-matching-everywhere.md)): give each action its own `On<T>`, and [DUCKY005](../diagnostics/DUCKY005.md) rejects a handler for an abstract type, an interface or `object`, which could never match.

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After.Tests/BehaviourChangeTests.cs#L63-L77

```csharp
[Fact]
public async Task Reducer_MatchesTheExactActionType_NotSubtypes()
{
    await using var store = TestStore.Create(ducky =>
    {
        ducky.ThrowOnUnhandledAction = false; // UrgentNotify has no handler of its own
        ducky.AddSlice<Fixtures.InboxSlice>();
    });

    await store.DispatchAsync(new Fixtures.UrgentNotify("fire")); // a Fluxor [ReducerMethod] for Notify would run
    store.State.Get<Fixtures.Inbox>().Last.ShouldBeNull();

    await store.DispatchAsync(new Fixtures.Notify("mail"));
    store.State.Get<Fixtures.Inbox>().Last.ShouldBe("mail");
}
```

### Registration is generated, not scanned

Fluxor finds features, reducers and effects with a [reflection scan](https://github.com/mrpmorris/Fluxor/blob/6.11.0/Source/Lib/Fluxor/DependencyInjection/ServiceCollectionExtensions.cs#L40) at startup; its maintainer notes that this scan is not compatible with Native AOT, while registering features, reducers and effects by hand is ([#507](https://github.com/mrpmorris/Fluxor/issues/507)). Ducky's generator emits the registration at build time, and its libraries are built with `IsAotCompatible` and checked by a Native AOT smoke test and a trimmed WebAssembly test ([SPEC §10](https://github.com/phmatray/Ducky/blob/v2/docs/spec/SPEC.md#10-serialization-and-aot-core-07-eng-08-inv-23-inv-24)).

Source: https://github.com/phmatray/Ducky/blob/v2/docs/migration/samples/fluxor/After.Tests/BehaviourChangeTests.cs#L117-L131

```csharp
[Fact]
public async Task GeneratedRegistration_ListsTheSliceAndEffects_WithoutAScan()
{
    var api = new FakeCounterApi();
    await using var store = TestStore.Create(
        ducky => ducky.AddDuckyGenerated_FluxorSample_After(), // emitted at build time: no reflection at startup
        services => services.AddSingleton<ICounterApi>(api).AddSingleton<ActionLog>());

    store.Slices.ShouldHaveSingleItem().ShouldBeOfType<CounterSlice>();
    await store.InitializeAsync(Xunit.TestContext.Current.CancellationToken);
    await api.Called(0); // LoadCounterOnStart and LoadCounterEffect were registered too
    api.Complete(0, 1);
    await store.Settled();
    store.State.Get<CounterState>().Count.ShouldBe(1);
}
```
