Function createComplexQueryEngine

  • This function creates a new function which can be used to implement a Store.query method by evaluating and filtering data available in an iterable, e.g. array.

    Type Parameters

    • T extends Readonly<Record<string, any>>

    Parameters

    Returns ((items) => ResultItems<T>)

    A function which filters, sorts and paginates the given query result.

    Example

    import { createComplexQueryEngine } from "store-api/utils";

    class MyStore{

    items = [{a:1},{b:2}];

    query(complexQuery, options){
    // filter, sort, paginate the items array
    return createComplexQueryEngine(complexQuery,options)(this.items);
    }
    }

Generated using TypeDoc