docs/vendor.js
function storeCleanupWithContext(view, context, cleanupFn) {
    if (!view)
        view = viewData;
    getCleanup(view).push(context);
    if (view[TVIEW].firstTemplatePass) {
        getTViewCleanup(view).push(cleanupFn, view[CLEANUP].length - 1);
    }
}
function storeCleanupWithContext(view, context, cleanupFn) {
    if (!view)
        view = viewData;
    getCleanup(view).push(context);
    if (view[TVIEW].firstTemplatePass) {
        getTViewCleanup(view).push(cleanupFn, view[CLEANUP].length - 1);
    }
}
function storeCleanupWithContext ( view , context , cleanupFn ) { if ( ! view ) view = viewData ; getCleanup ( view ) . push ( context ) ; if ( view [ TVIEW ] . firstTemplatePass ) { getTViewCleanup ( view ) . push ( cleanupFn , view [ CLEANUP ] . length - 1 ) ; } }
Saves context for this cleanup function in LView.cleanupInstances.

On the first template pass, saves in TView:
- Cleanup function
- Index of context we just saved in LView.cleanupInstances
Saves context for this cleanup function in LView . cleanupInstances .