Open zabojad opened 5 years ago
Can you post the errors and/or a reduced example/project that we can try to compile?
There are no macros involved in this part of the code:
Action
(indispatch(action:Action)
) is an abstract wrapping the enum value into a redux action:
https://github.com/elsassph/haxe-redux/blob/master/redux/Redux.hx#L61
StoreBuilder
mapping methods create a matcher using the enum type name:
https://github.com/elsassph/haxe-redux/blob/master/redux/StoreBuilder.hx#L14
I'm not sure enums really work with generics here. I tried that: https://try.haxe.org/#E2483
I guess it could somehow work, but not the way you expect.
I'm wondering how to achieve generic actions/states/reducers with this lib...
The idea is to define some "generic feature redux brics" like for example an entity list redux bric.
I've tried something like this:
Generic stuff:
and a use of it:
It doesn't compile with errors I do not really understand as it reaches my knowledge limits about haxe macros used in this lib implementation.
So, before losing more time trying to make it work probably in vain, I'd prefer ask the question here. Would haxe-redux allow such definition of action/state/reducer ?
If yes, what do I do wrong?
If no, would that be a lot of work to add it to the lib?
Thanks in advance for your answers...