This solution is less ideal than being able to use import for legacy
modules, but gets mad points for simplicity.
The next question is this: what will happen if "require" is used to load
an ES6 module (specifically, a module that contains import statements)?
Dave, is it possible to create an effectively synchronous loader using the
Loader API?
let syncLoader = new Loader(parent, {
fetch: function(relURL, baseURL, request, resolved) {
let src = fetchSourceFromDisk(resolved);
request.fulfill(src); // Fulfill in same turn of the event loop
}
}
syncLoader.load("abc");
// Is ABC ready at this point?
let ABC = syncLoader.get("abc");
- Kevin
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss