Closed iamchanii closed 5 years ago
Thanks! But unfortunately this does not work. I extended your test to actually test action dispatching with the custom prefix.
It fails because createReducerFunction
must also known about the custom prefix:
I wonder if it would be better to just expose a function setPrefix
which sets the internal PREFIX
. Then there would be no need to manually pass the prefix for all createActions
and createReducerFunction
calls. It would not be as flexible though (and mutating internals is not that cool).
Usage would be like this:
import {setPrefix} from "immer-reducer";
setPrefix("MY_PREFIX");
I see. I'll be done before next weekend. Thanks for your advice and kind!
I fixed! I'd be glad to you review my code.
FYI: I changed prefix variable name to actionTypeName
from PREFIX
. because, I think it is not anymore constraint variable if this PR approved.
Thanks! Available now in 0.3.0 🚀
Issue: #12