danwrong / loadrunner

Simple, flexible and sane JavaScript loader and build tool for browsers.
MIT License
277 stars 40 forks source link

using is "asynchronous -- unless the scripts have already been loaded" #3

Closed fat closed 13 years ago

fat commented 13 years ago

That inconsistency seems odd to me. Why not always make using non blocking?

danwrong commented 13 years ago

Well, basically the callback fires immediately. We could put a setTimeout(0) around it but Im not sure whether its worth it. Are there situations where this would be a good idea?

On Wed, May 18, 2011 at 1:15 PM, fat reply@reply.github.com wrote:

That inconsistency seems odd to me. Why not always make using non blocking?

Reply to this email directly or view it on GitHub: https://github.com/danwrong/loadrunner/issues/3

Dan Webb http://massiverobot.co.uk http://www.danwebb.net

aim: danwrong123 twitter/skype: danwrong

fat commented 13 years ago
//foo/bar has already been loaded
using('/foo/bar', function() { really huge method with lots of logic });

//foo hasn't been loaded
using('/foo', function() {...});

i'd want foo script to start fetch before waiting for my method above to finish execution

fat commented 13 years ago

it's not really a big deal to me... It was just weird when i read it. I'll reopen if it ever comes up in real developement