Defines the logic that is invoked after all operations have been finished.

import Batch = require("nativescript-batch");

var b = Batch.newBatch(function(ctx) {
    ctx.checkIfFinished();  // nothing happens
}).then(function(ctx) {
    ctx.checkIfFinished();  // invokes "whenAllFinished" action
});

b.batch.whenAllFinished(function(ctx) {
    console.log("All finished!");
});

b.start();