Great article! I agree that different situations may call for different techniques.
If I expect the functions in the module to be used often and holistically, I may use default export at the end of my file instead of defining exports on each function:
Great article! I agree that different situations may call for different techniques.
If I expect the functions in the module to be used often and holistically, I may use default export at the end of my file instead of defining exports on each function:
...and I'll name my module something generic like Math. Or in the example you showed above, Rotate instead of detectRotation.
Named exports may be more readable to some, but sometimes it may be preferable to see the function and the module in which it came from.
Thanks!
And yes, I agree that is a great way to export utils functions. 👍🏽