FILTER
Filter engine for array of objects. Filter will not work with plain array.
Installation
npm install --save data-filter
Example Usage
; var Filter = ;
Example data
const a = 'column1': 1 'column2': false 'column3': 'test' 'column1': 2 'column2': true 'column3': 'test2'
Constructor
Creating new Filter instance
const filter = data: ; const filter2 = sortEngine: ;
Data
// Setter filterData = ; filter; filterData = undefined; // Will set data to empty array // Getter const originalData = sortData; const filteredData = sortFilteredData; const filteredData = sort;
Adding filter value
You can add or create new filterValue, it is possible to add multiple FilterValues and once with update function.
const filtered = filter; const filtered = filter;
Removing filter value
You can remove filter by its name or you can pass filterValue instance
const filtered = filter; const filtered = filter;
Clear filters
const filtered = filter;
Getting filter
const filter = filter;
Sort engine
It is possible to pass sort engine object to filter, this will always return filtered and sorted data by criteria added to filter and sort.
filterSortEngine = ; const sortEngine = filterSortEngine; // See: sort-engine filterSortEngine