Closed bolasblack closed 6 years ago
That code path is reached if a user tries to define a new bundle using an old name. If you want to add a new success callback to a previously-defined bundle you can use the .ready()
method:
// define bundle and add a success callback
loadjs(['/file1.js', 'file2.js'], 'mybundle', function() {
/* success-callback-1 */
});
// add another success callback
loadjs.ready('mybundle', function() {
/* success-callback-2 */
});
Got it :P
Thanks
The code is here:
https://github.com/muicss/loadjs/blob/b1795cf94a3429619c3dfe947fcb303c6d4e6b65/src/loadjs.js#L217-L224
This behavior looks so weird to me.
Is there any reason for doing this?