minor fixes

This commit is contained in:
Ilya Kantor 2021-05-24 11:23:44 +03:00
parent 3e74537ea4
commit 006343a653

View file

@ -123,9 +123,11 @@ That said, making such global variables is frowned upon. Please try to avoid the
### A module code is evaluated only the first time when imported
If the same module is imported into multiple other places, its code is executed only the first time, then exports are given to all importers.
If the same module is imported into multiple other modules, its code is executed only once, upon the first import. Then its exports are given to all further importers.
That has important consequences. Let's look at them using examples:
The one-time evaluation has important consequences, that we should be aware of.
Let's see a couple of examples.
First, if executing a module code brings side-effects, like showing a message, then importing it multiple times will trigger it only once -- the first time: