Odonno / ReduxSimple

Simple Stupid Redux Store using Reactive Extensions
http://www.nuget.org/packages/ReduxSimple/
MIT License
144 stars 20 forks source link

There is an ArgumentException on RemoveAll entity adapter method invocation. #93

Closed p1eXu5 closed 3 years ago

p1eXu5 commented 3 years ago

There is an ArgumentException on RemoveAll entity adapter method invocation.

In the current version:

public TEntityState RemoveAll<TEntityState>(TEntityState state)
    where TEntityState : EntityState<TEntity, TKey>
{
    var collection = new Dictionary<TEntity, TKey>();
    return state.With(new
    {
        Ids = collection.Keys.ToList(),
        Collection = collection
    });
}

To fix this the dictionary parameters should be inverted:

...
var collection = new Dictionary<TKey, TEntity>(); 
...
Odonno commented 3 years ago

Well, I am not sure why I kept the <TEntity, TKey> in that order. I will invert this order to be logical. Note that there will be a small breaking change then.

Odonno commented 3 years ago

Fixed. You should see the v3.6.1-preview002 in a few minutes.

Enjoy!