Let's say I have a module A
that is imported by module B
in a webpack
project.
A.js
const variable = synchronousGetData()
export function exportedFunction() {
// do some work with variable
}
B.js
import { exportedFunction } from 'A'
exportedFunction()
Is variable
guaranteed to be fully instantiated (e.g. the synchronous work will have been done and assigned to variable
via synchronousGetData()
?)
I can only think of the case where module A
requires B
as well, in which case you have a circular dependency, and this could throw things off, correct? But if no circular dependency is present then does the above guarantee exist?