lib/request/GetRequestV2.js
function(requested, err, data, mergeContext) {
        var self = this;
        var model = self.requestQueue.model;
        var modelRoot = model._root;
        var errorSelector = modelRoot.errorSelector;
        var comparator = modelRoot.comparator;
        var boundPath = model._path;

        model._path = emptyArray;

        // flatten all the requested paths, adds them to the
        var nextPaths = model._useServerPaths ? data.paths : flattenRequestedPaths(requested);

        // Insert errors in every requested position.
        if (err && model._treatDataSourceErrorsAsJSONGraphErrors) {
            var error = err;

            // Converts errors to objects, a more friendly storage
            // of errors.
            if (error instanceof Error) {
                error = {
                    message: error.message
                };
            }

            // Not all errors are value $types.
            if (!error.$type) {
                error = {
                    $type: $error,
                    value: error
                };
            }

            var pathValues = nextPaths.map(function(x) {
                return {
                    path: x,
                    value: error
                };
            });
            setPathValues(model, pathValues, null, errorSelector, comparator, mergeContext);
        }

        // Insert the jsonGraph from the dataSource.
        else {
            setJSONGraphs(model, [{
                paths: nextPaths,
                jsonGraph: data.jsonGraph
            }], null, errorSelector, comparator, mergeContext);
        }

        // return the model"s boundPath
        model._path = boundPath;
    }
function(requested, err, data, mergeContext) {
        var self = this;
        var model = self.requestQueue.model;
        var modelRoot = model._root;
        var errorSelector = modelRoot.errorSelector;
        var comparator = modelRoot.comparator;
        var boundPath = model._path;

        model._path = emptyArray;

        // flatten all the requested paths, adds them to the
        var nextPaths = model._useServerPaths ? data.paths : flattenRequestedPaths(requested);

        // Insert errors in every requested position.
        if (err && model._treatDataSourceErrorsAsJSONGraphErrors) {
            var error = err;

            // Converts errors to objects, a more friendly storage
            // of errors.
            if (error instanceof Error) {
                error = {
                    message: error.message
                };
            }

            // Not all errors are value $types.
            if (!error.$type) {
                error = {
                    $type: $error,
                    value: error
                };
            }

            var pathValues = nextPaths.map(function(x) {
                return {
                    path: x,
                    value: error
                };
            });
            setPathValues(model, pathValues, null, errorSelector, comparator, mergeContext);
        }

        // Insert the jsonGraph from the dataSource.
        else {
            setJSONGraphs(model, [{
                paths: nextPaths,
                jsonGraph: data.jsonGraph
            }], null, errorSelector, comparator, mergeContext);
        }

        // return the model"s boundPath
        model._path = boundPath;
    }
function ( requested , err , data , mergeContext ) { var self = this ; var model = self . requestQueue . model ; var modelRoot = model . _root ; var errorSelector = modelRoot . errorSelector ; var comparator = modelRoot . comparator ; var boundPath = model . _path ; model . _path = emptyArray ; // flatten all the requested paths, adds them to the var nextPaths = model . _useServerPaths ? data . paths : flattenRequestedPaths ( requested ) ; // Insert errors in every requested position. if ( err && model . _treatDataSourceErrorsAsJSONGraphErrors ) { var error = err ; // Converts errors to objects, a more friendly storage // of errors. if ( error instanceof Error ) { error = { message : error . message } ; } // Not all errors are value $types. if ( ! error . $type ) { error = { $type : $error , value : error } ; } var pathValues = nextPaths . map ( function ( x ) { return { path : x , value : error } ; } ) ; setPathValues ( model , pathValues , null , errorSelector , comparator , mergeContext ) ; } // Insert the jsonGraph from the dataSource. else { setJSONGraphs ( model , [ { paths : nextPaths , jsonGraph : data . jsonGraph } ] , null , errorSelector , comparator , mergeContext ) ; } // return the model"s boundPath model . _path = boundPath ; }
merges the response into the model"s cache.
merges the response into the model s cache .