GuillaumeSalles / redux.NET

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

Combine Reducer #38

Open gpltaylor opened 8 years ago

gpltaylor commented 8 years ago

Is there an ability to support combined Reducers? I have looked over the code and can't see this.

It would be a great feature!

lilasquared commented 7 years ago

@gpltaylor lots of the stuff from redux that is cool is allowed because it is javascript which doesn't have type safety. I think that @GuillaumeSalles was trying to create something that follows redux patterns as well as conforming to type safety of C#. (we discussed a similar issue with middleware here) I can't think of a way to implement combine reducers without using a dictionary type definition for the state but then the type safety is gone and you might as well be writing javascript =]

lilasquared commented 7 years ago

@gpltaylor I thought about this for a long time and finally came up with something that does the trick. check out my implementation https://github.com/lilasquared/NRedux. I would like to see if I can work it into Redux.Net as well @GuillaumeSalles if you like mine I can try and come up with a PR for you.

lilasquared commented 7 years ago

@gpltaylor if you're still interested in this we had a discussion about it here https://github.com/GuillaumeSalles/redux.NET/issues/51. It turns out if you design the state object and reducers in a better way than i was doing you don't need a combine reducers method. Let me know if that works for you!