GuillaumeSalles / redux.NET

Redux.NET is a predictable state container for .NET apps. Inspired by https://github.com/reactjs/redux.
712 stars 86 forks source link

Make InnerDispatch protected virtual #60

Open cmeeren opened 7 years ago

cmeeren commented 7 years ago

Since Store is a low-level API, we should be able to override its members. I've made PR #61 for this.

I came across the need for overriding InnerDispatch when trying to subclass Store to create a kind of ObservableActionStore that surfaces a property IObservable<IAction> Actions. This should only be fired (OnNext called) when the action reaches the inner dispatch, but to override InnerDispatch it needs to be protected virtual.

Edit, see #63 for a better solution to this paragraph. In addition, we might consider implementing IObservable Actions { get; } in the base store. As far as I can see, the functionality would be orthogonal to everything we currently have. With the possible exception of the return value of Dispatch, but maybe an observable of actions would be a more robust solution to whatever needs are currently being served by this return value?

@dcolthorp might have some input here.