dojo/store/util/QueryResults

Authors:Kris Zyp
Project owner:Kris Zyp
since:V1.6

Introduction

The QueryResults utility function provides convenient wrapping of arrays and promises as valid result sets. The QueryResults can be called with a plain array or a promise that will resolve to an array. The function will return a result set that has the required forEach, filter, and map methods.

Examples

require(["dojo/store/util/QueryResults"],
    function(QueryResults){
        var someData = [
            {id:1, name:"One"},
            {id:2, name:"Two"}
        ];
        var results = QueryResults(someData);
        results.forEach(objectHandler); // works in all browsers
});
Error in the documentation? Can’t find what you are looking for? Let us know!