Closed aaranadev closed 3 years ago
This pull request has been linked to Clubhouse Story #160565: Improve styleguide in hygen template.
More harder that this?
You're introducing two ways of import.
More harder that this?
It's not a problem about default, it's a problem of the name of the function
I think the functionality if you reference the function named formulateModel
the destructuring is unnecessary.
For example:
import getFormulaModel from 'data/models/FormulaModel';
The documentation:
Named exports are useful to export several values. During the import, one will be able to use the same name to refer to the corresponding value. Concerning the default export, there is only a single default export per module. A default export can be a function, a class, an object or anything else. This value is to be considered as the “main” exported value since it will be the simplest to import.
In general, a model should have more than 1 function. For example StoresModel could have: getStoreById, getAllStores, findNearestStore...
You can do:
import getStoreById, {getAllStores, findNearestStore} from ...
I know it's allowed and in several libraries (like react for example) is useful because a method is clearly more used than the rest, but not apply for models
Ok, I understand, I change it
Done
This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.
🔍 Inspect: https://vercel.com/carto-frontend/cra-template-carto/4FYz1F7tSSXz5opXNwqxooFF8Ya8
✅ Preview: https://cra-template-carto-git-feature-ch160565-carto-frontend.vercel.app