jrburke/requirejs — Issue #144: Support for deferreds ?
Author: FredyC
Created: 2011-11-16 21:58:00+00:00
State: open

Hello. I am just wondering if this is somehow planned or not and why. I had discovered deferreds just recently and i am loving it already. It really makes whole code much cleaner.

I had noticed, that require call is not returning nothing useful, so it shouldn't do any harm, if there would be promise object returned, right ?

With that i can do something like `var dfd = $.when( require[ 'someModule' ] )` which gives me another promise object that can be stored for later use. This way i can stay DRY and instead of repeating long list of common modules i just use one variable and call the `dfd.done()` method on it to get modules that might not be loaded yet.

So what do you think about it ?