examples/preact/index.js
function onDataFetch(query, resolve) {
    let output = [];

    query.forEach(function(query) {
        let filteredItems = data.filter(function(obj) {
            return obj.parent === query.parent;
        });

        output.push({
            parent: query.parent,
            items: filteredItems.splice(query.offset, query.limit)
        });

    });

    resolve(JSON.parse(JSON.stringify(output)));
}
function onDataFetch(query, resolve) {
    let output = [];

    query.forEach(function(query) {
        let filteredItems = data.filter(function(obj) {
            return obj.parent === query.parent;
        });

        output.push({
            parent: query.parent,
            items: filteredItems.splice(query.offset, query.limit)
        });

    });

    resolve(JSON.parse(JSON.stringify(output)));
}
function onDataFetch ( query , resolve ) { let output = [ ] ; query . forEach ( function ( query ) { let filteredItems = data . filter ( function ( obj ) { return obj . parent === query . parent ; } ) ; output . push ( { parent : query . parent , items : filteredItems . splice ( query . offset , query . limit ) } ) ; } ) ; resolve ( JSON . parse ( JSON . stringify ( output ) ) ) ; }
Called by the VST to get data.

@method onDataFetch
Called by the VST to get data .