Improving a JQuery Promise "Chain" I have a little chain of JQuery promises.  My problem is at each stage I want to notify my progress to the user, keep them in the loop (Perhaps using .notify somehow?)

What I've eneded up with is this bizarre mess of callbacks and promises.  It works but I'm quite certain there is a neater, more logical way to do this.

both fetchSomeData() and Parser() return a promise

    var parseData = function(json)
    {
        showMessage("Updating your data...");
        return new Parser(json);
    };

    var onParseDone = function()
    {
        hideMessage();
        updateView();
    };

    showMessage("Fetching a bit of data...");
    fetchSomeData().pipe(parseData).done(onParseDone);
Surely this is possible. Only the fetch and parse functions would need to call notify with the respective message on the Deferreds they return. The code then could look like this:

fetchSomeData().pipe(parser).progress(showMessage).done(hideMessage, updateView);