-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change translate() parameter #48
Comments
As we discussed, I'd personally prefer that translate can be called either :
Why would you want to forbid the first one ? |
because it's more simple to use and to remind.
|
Mmm .. why not.
or, in other words :
? It seems more complicated, but it enables us to support more option if the future, without changing signature. |
One more thing ... maybe we could choose between
If we want to maintain both, and keep using curry, to handle this call :
We will have to test first arg type in translate to know if it's option or component. This is Because of the way curry works :
output :
|
let's go for :
|
or |
At the moment Would you accept a PR to fix this use-case and land it on the current version? As I can see, the goal is later to move the react specific functionality to |
Yes, it is a known problem. As to the future of react-redux-polyglot package, we are discussing to have it as another npm module but in the same repo. |
I've started to refactor translate : https://github.com/Tiqa/redux-polyglot/tree/feat/multi_module_refacto |
call
translate(DummyComponent)
should be forbidden.should be call like this :
translate()(Dummy)
translate('')(Dummy)
translate('', Dummy)
The text was updated successfully, but these errors were encountered: