How to solve this basic ES6-module circular dependency problem?
joe at trusktr.io
Wed Aug 24 18:28:12 UTC 2016
Thanks for that explanation Logan, that was very helpful!
I understand correctly, function scopes are instantiated only right before
a function will run, while the module scopes are all instantiated first
before any modules are evaluated, not right before the module code will be
evaluated. That's where my assumption was wrong, as I was thinking that the
hoisting would happen right before module evaluation (similar to
functions), and therefore it would have been impossible for module B to
access initC in your example, but now I get it. Thanks a ton!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss