js/Request.js
function () {

                var that = this,
                    paramHandler = this.params.handler,
                    params = util.mixin({}, this.params);

                //wrap the handler callbacks in a cancel check
                function handler(responseCode, data, ioArgs) {
                    that.xhr = ioArgs.xhr;
                    that.statusCode = that.xhr && !that.xhr.timedOut && that.xhr.status || 0;
                    if (that.canceled) {
                        logger.debug("Request [" + that.id + "] was canceled, not calling handler");
                    } else {
                        that.pending = false;
                        that.complete = true;
                        paramHandler(responseCode, data, ioArgs);
                    }
                }

                if (this.canceled) {
                    logger.debug("Request [" + that.id + "] was canceled, not executing");
                } else {
                    this.pending = true;
                    this.fn(util.mixin(params, {
                        handler: handler
                    }));
                }
            }
function () {

                var that = this,
                    paramHandler = this.params.handler,
                    params = util.mixin({}, this.params);

                //wrap the handler callbacks in a cancel check
                function handler(responseCode, data, ioArgs) {
                    that.xhr = ioArgs.xhr;
                    that.statusCode = that.xhr && !that.xhr.timedOut && that.xhr.status || 0;
                    if (that.canceled) {
                        logger.debug("Request [" + that.id + "] was canceled, not calling handler");
                    } else {
                        that.pending = false;
                        that.complete = true;
                        paramHandler(responseCode, data, ioArgs);
                    }
                }

                if (this.canceled) {
                    logger.debug("Request [" + that.id + "] was canceled, not executing");
                } else {
                    this.pending = true;
                    this.fn(util.mixin(params, {
                        handler: handler
                    }));
                }
            }
function ( ) { var that = this , paramHandler = this . params . handler , params = util . mixin ( { } , this . params ) ; //wrap the handler callbacks in a cancel check function handler ( responseCode , data , ioArgs ) { that . xhr = ioArgs . xhr ; that . statusCode = that . xhr && ! that . xhr . timedOut && that . xhr . status || 0 ; if ( that . canceled ) { logger . debug ( "Request [" + that . id + "] was canceled, not calling handler" ) ; } else { that . pending = false ; that . complete = true ; paramHandler ( responseCode , data , ioArgs ) ; } } if ( this . canceled ) { logger . debug ( "Request [" + that . id + "] was canceled, not executing" ) ; } else { this . pending = true ; this . fn ( util . mixin ( params , { handler : handler } ) ) ; } }
Calls the specified data function, passing in the params.
This allows us to wrap these calls with a cancellation check.
Note that scope is ignored - the ultimate callback scope is defined wherever the provider method is ultimately called.
Calls the specified data function passing in the params . This allows us to wrap these calls with a cancellation check . Note that scope is ignored - the ultimate callback scope is defined wherever the provider method is ultimately called .