So we're using iOS modules.
Turns out there are some variations of that export and import syntax which you should be aware of.
For example you can bundle imports let's say here and project input where I'm importing two things from
the validation file here.
You might want to group that all into one object where you then can call dot validate Abel and Dot validate
so that you don't have to call validate like this.
Maybe you want to call it like this but if you had let's say a function of the same name in here or
anything like that and you want to a a name clash or you want to make it clear that this belongs to
some kind of package you could group that to group imports.
You don't import them like this with the curly braces but instead you use a star here which means import
everything from the file s and then any alias of your choice for example validation.
Now you have to go to the places where you use something from that file and use it like object validation
dot validate all so everything which is exported in that file which are now group under this name here
is access through the dot notation.
So validation dot validated Bill all the way and then all down there where we have to validate function.
It's of course validation dot validate validation dot validate and validation dot validate.
And with that you will see well validation works.
So grouping is one thing you can do that Alice thing here is also something you can do in general you're
not liking order bind like this you want to have a capital character at the beginning while you can
simply assign an alias with the s keyword here inside of the curly braces.
You can use it as well.
Then you rename this import and only dis import you don't rename it in your original file of course
it's only imported under a different name in this file here.
So now instead of using all the bind with a lowercase a here we now have to use our alias name with
the uppercase a.
So that can be a number nice feature to avoid name clashes if you had a number of thing named to bind
with a lowercase a in the same file for example you can also work with default exports if you have a
file which only exports one thing let's say base component.
Actually we have a lot of files that only export one thing.
But let's say here in this fall we don't want to export did like this a so-called named export because
we imported by name here in the curly braces we need to use the exact name we use here.
If you don't want to do that you simply add another keyword default.
And this tells javascript that this is the main well the default export office file you could still
have our named exports here.
That would be allowed whips for example a constant here that would be allowed you can if named and default
exports mixed in the same file but if you use a default export you can only have one default export
per file.
So here I have my default export and now in the files were imported.
You don't imported by name you can only import named exports by name for example.
That's something constant added.
Instead you import your default simply by choosing any name of your choice now which doesn't have to
match the name you used in the export that file so you don't have to use component.
Now you could you use just CFP for example here now and imported like this without curly braces.
There also is no star.
So I'm not importing everything I'm just importing the default.
Therefore this is only available if the file you're importing from has a default export because this
tells javascript hey I want to use the default export of that file then here I can name the CFP of course
or I have to use CFP of course now component is not allowed anymore because I'm not importing it by
that name.
Of course we now all need to tweet this and project item and project list we used to default export.
I will stick to component here but you don't have to as I just showed you could use any name you want
here but for simplicity I will use component here.
Default exports can be nice if you only have one thing per file.
I personally prefer named exports though because you get auto completion you enforce a clear naming
pattern.
If another developer imports your class or your export that thing he has to use your name which typically
is good because it allows you to enforce certain naming conventions across a team or organization.
And therefore I personally like named exports but of course you should be aware of the default export
as well which you can use like that.