MiroHibler / meteor-preloader

A Meteor "lazy-loader" for external .js and .css libraries
75 stars 3 forks source link

onAfterAsync never called #15

Open timothyarmes opened 9 years ago

timothyarmes commented 9 years ago

onAfterAsync never called is never called.

Looking at the code, it seems that you've forgotten to add it to the collection of Router Libraries

MiroHibler commented 9 years ago

Nope - it's there:

/lib/client_route_controller.js:47

...
loadAsync = function () {
        var asyncLibs          = thisRoute._libs.sources.async,
            beforeAsyncHandler = thisRoute._libs.onBeforeAsync,
            asyncHandler       = thisRoute._libs.onAsync,
--->        afterAsyncHandler  = thisRoute._libs.onAfterAsync;
...

/lib/client_route_controller.js:118

...
if ( afterAsyncHandler ) {
    afterAsync = afterAsyncHandler( asyncLib );
}

if ( afterAsync ) {
...

How do you call it?