3 ms·
FWIW they did it[0]. Alameda is promise based AMD from the same folks that were key in AMD being successful when it was so successful [0]: https://github.com/r
by no_wizard 3y ago
FWIW they did it[0]. Alameda is promise based AMD from the same folks that were key in AMD being successful when it was so successful
[0]: https://github.com/requirejs/alameda https://github.com/requirejs/alameda
- bastawhiz 3y agoAlameda does a great job of explaining why you can't just slap promises on something: it breaks the semantics of what `require()` returns. `require('foo')` returns foo, maybe. `require(['foo'])` returns `Promise<[foo]>`.
- ComputerGuru 3y agoThat's correct. For my own library (see sibling comment above) I started off with a single `require()` entry point that can be used to load a dependency, load a dependency and invoke a callback, or asynchronously load a dependency (e.g. return a promise) but then changed it to two separate functions (everyone's favorite `require()` plus an async version very cleverly named `requireAsync()`).