Redux 1.0.11

Install-Package Redux -Version 1.0.11
dotnet add package Redux --version 1.0.11
<PackageReference Include="Redux" Version="1.0.11" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Redux --version 1.0.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Redux, 1.0.11"
#r directive can be used in F# Interactive, C# scripting and .NET Interactive. Copy this into the interactive tool or source code of the script to reference the package.
// Install Redux as a Cake Addin
#addin nuget:?package=Redux&version=1.0.11

// Install Redux as a Cake Tool
#tool nuget:?package=Redux&version=1.0.11
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Redux mini for .NET

It's simple "application state" container implementation like Redux for JavaScript.

How does it work?

Application state container is just plain IDictionary<string, object> instance.

You can manage application state with just three methods of Store instance:

public interface Store
  void Dispatch(Message message);

  IDictionary<string, object> GetState();

  Action Subscribe(Action<Message> handler);

"Send" Message to Store with Dispatch method:

string type = "User";

User user = new User()
  Email = "joedoe@mail.local" 

Message message = new Message(type, user);


Get application container state from Store with GetState method:

IDictionary<string, object> state = store.GetState();

User user = state["User"] as User;

Know about application state change with Subscribe method:

public class CustomHandler
  private Store store;
  public CustomHandler(Store store)
  { = store;

  public void Handle(Message message)
    IDictionary<string, object> state =;

    /// React state change here

CustomHandler handler = new CustomHandler(store);

Action unsubscribe = store.Subscribe(handler.Handle);

How to configure own application container?

Make a collection of Reducer-s with built-in tools:

List<Reducer> reducers = new List<Reducer>();

reducers.Add(new ReducerImpl("Order"));
reducers.Add(new ReducerImpl("Payment"));
reducers.Add(new ReducerImpl("Withdrawal"));
reducers.Add(new ExceptionReducerImpl());

/// And pass it to constructor of 
/// built-in Store implementation
Store store = new StoreImpl(reducers);

And you are ready to play with your application container. As you can see it knows about four Message types:

  • "Order"
  • "Payment"
  • "Withdrawal"
  • "Exception"

It will ignore any other unknown type Message-s.

Tool to get value from state container

There is built-in StoreValueProvider utility:

Order order = new Order();
Message message = new Message("Order", order);

StoreValueProvider provider = new StoreValueProviderImpl();



Assert.Equal(order, provider.get<Order>());
Assert.Equal(order, provider.get(typeof(Order)));

  • .NETCoreApp 2.2

    • No dependencies.
  • .NETCoreApp 3.0

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.11 532 11/7/2019
1.0.10 231 11/3/2019
1.0.9 242 11/3/2019
1.0.6 443 7/7/2019
1.0.5 291 7/6/2019
1.0.3 302 7/2/2019
1.0.2 307 6/24/2019
1.0.1 335 6/15/2019
1.0.0 796 1/9/2019

Reducers types check has been added to StoreImpl constructor. canGet method has been defined in StoreValueProvider.