Skip to content

Releases: le-nn/memento

v1.7.0 API improvements

19 Feb 06:10
Compare
Choose a tag to compare

What's Changed

  • API Improvements
    Stopped covariance of IStore<object, object> and made IStore an interface.
    Changed the TMessage constraint from class to notnull in Store<TState, TMessage>.

Changed the class that notifies state changes from AbstractStore to derive from the more general StateObservable.
https://github.com/le-nn/memento/blob/main/src/Memento.Core/StateObservable.cs

Full Changelog: v1.6.0...v1.7.0

v1.6.0 .NET 8 support

21 Nov 18:18
f541735
Compare
Choose a tag to compare

Add support for .NET 8

What's Changed

  • Add support for net8.0 by @le-nn in #23
  • Fix errors during initializing on Blazor Server

Full Changelog: v1.5.0...v1.6.0

v1.5.0

21 Jul 16:45
d9a6c0c
Compare
Choose a tag to compare

What's Changed

  • Change the Store to have a typed Payload explaining what the change has been in StateHasChangedEventArgs when mutating the State of the Store. by @le-nn in #18
  • Feature/history api improvements by @le-nn in #21

Full Changelog: v1.4.1...v1.5.0

v1.4.1 Add Support for selecting Service type of Singletone or Scoped

31 Mar 10:12
Compare
Choose a tag to compare

Add Support for selecting Service type of Singletone or Scoped

The registration to the service used to be AddScoped, but now you can choose between Singleton and Scoped.

If isScoped: false, it will be registered as a Singleton, if isScoped: true, it will be registered as a Scoped service.
In the case of Blazor Server, the state is separated for each user session, so the argument isScoped: true must be set or the state will be shared by all users.
The default args is isScoped: true.

using Memento.Blazor;

var builder = WebAssemblyHostBuilder.CreateDefault(args);
builder.RootComponents.Add<App>("#app");
builder.RootComponents.Add<HeadOutlet>("head::after");

builder.Services
    // Add necessary modules to Memento
    .AddMemento(isScoped: false)
     // Add middleware
    .AddMiddleware<LoggerMiddleware>(isScoped: false)
     // Add by specifying Store
    .AddStore<AsyncCounterStore>(isScoped: false)
    // Scan the assembly and register all classes that implement the IStore interface
    .ScanAssemblyAndAddStores(typeof(Program).Assembly, isScoped: false);

await builder.Build().RunAsync();

Full Changelog: v1.4.0...v1.4.1

v1.4.0

23 Mar 10:32
f401674
Compare
Choose a tag to compare

What's Changed

  • support redux devtools and adjusts namespace (Fix #4) by @le-nn in #15
  • Support HandleDisposable on Store and ObserverComponent that realizes handling IDisposable. Generated disposables will be Disposed when the component is destroyed.
    Express Subscribing of Events declaratively and safely.
    Overrides on ObserverComponent or Store<>

An example on Store

    protected override IEnumerable<IDisposable> OnHandleDisposable() {
        yield return _loading.Subscribe(e => {
            Mutate(state => state with { LoadingState = e, });
        });
    }

Full Changelog: v1.3.1...v1.4.0

v1.3.1

21 Feb 18:07
255888b
Compare
Choose a tag to compare

What's Changed

  • Feature/basic store pattern by @le-nn in #12
  • Feature/state has changed by @le-nn in #13
  • Fix some typos
  • Add Support for ReduxDevTools

Change Store APIs

  • Change RootState Type from ImmutableDictionary to Dictionary
  • Change Store to FluxStore
  • Using the AbstractStore class as the base class