Odonno / ReduxSimple

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

Encapsulate Reduce method #15

Closed mhusainisurge closed 6 years ago

mhusainisurge commented 6 years ago

Does the Reduce method need to be public? I suppose there's no harm, but there seems to be no real need to expose it by default.

mhusainisurge commented 6 years ago

Another thought: I am not sure why it need to even have a default implementation. Any reason it can't just be an abstract method? A store that never changes state is probably an extremely rare case.

Odonno commented 6 years ago

@mhusainisurge By default, it returns the same state. I copied the same behavior of redux in js but instead of using a switch, I used methods and the default one is relative to the default case in js.

And at least, devs don't have to do anything to have a proper Redux store working. It's a no-updated state implementation but that's the starting point.

Odonno commented 6 years ago

And on the other question, yes, the Reduce function should be protected.

mhusainisurge commented 6 years ago

Ok, just wanted to check about the default implementation. I'll make the method protected.