-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
Checklist: convert export default to named export #600
Comments
hello, can I have this task? I'll start with the first 3 ones: variable-length-quality, strain and palindrome-products. If things goes well I can do the remaining ones. |
@smb26 sure! Just edit your message and say which one you're fixing :) |
Thank you! |
Hey @SleeplessByte, can I do a single pull request with the changes on all the six remaining exercises or should I keep doing separate pull requests? |
I prefer separate @smb26 , but you can just keep them all open at the same time. |
Hello, I have a doubt for the palindrome exercise - on the example, what is being exported is a generate function that will return two objects: largest and smallest, each with value and factors. To change it for a named export, should I split it, ending up with two methods that each will return an object? |
I'd say no. It's outside of the scope of converting default export to named export. It would change how the solution works internally, not only how the code is exported. You can see in the example that it uses the same loop to generate both results. These calculations are interlinked and it makes sense to do them in one function. If you think the exercise would be better if split into two separate functions, you can present your arguments – you may be right, maybe it should be split, but I think it's a separate issue. |
Honestly, I don't feel like it has something to be split, but since the run-length had a separation between functions, I decided to ask about the best strategy. Thank you @sin |
@smb26 Right now it's expecting a single function as default export. When you do this one, I would make it maybe expect - const Palindromes = (params) => {
+ export const palindromes = (params) => {
...
- export default Palindromes; |
A humongous thanks to @smb26 ! Thank you for making this happen 💟 |
Follow up on #436 and the implementation #599 .
The text was updated successfully, but these errors were encountered: