minor fixes
This commit is contained in:
parent
2fc7cb2d42
commit
649a1598f5
1 changed files with 3 additions and 1 deletions
|
@ -184,7 +184,9 @@ As you can see, when `1.js` changes the `name` property in the imported `admin`,
|
||||||
|
|
||||||
That's exactly because the module is executed only once. Exports are generated, and then they are shared between importers, so if something changes the `admin` object, other modules will see that.
|
That's exactly because the module is executed only once. Exports are generated, and then they are shared between importers, so if something changes the `admin` object, other modules will see that.
|
||||||
|
|
||||||
Such behavior allows us to *configure* modules on first import. We can setup its properties once, and then in further imports it's ready.
|
**Such behavior is great in practice, because it allows us to *configure* modules on first import.**
|
||||||
|
|
||||||
|
We can setup its properties once, and then in further imports it's ready.
|
||||||
|
|
||||||
For instance, the `admin.js` module may provide certain functionality, but expect the credentials to come into the `admin` object from outside:
|
For instance, the `admin.js` module may provide certain functionality, but expect the credentials to come into the `admin` object from outside:
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue