Introduction
This is a Javascript facet filtering based on Typescript. Easily integrated with modern Javacript Framework or any Nodejs backend project.
Get started
Install
With npm:
npm install -S lazy-facet
Settings
Config passing in: { data: [] - require. execOnChange: true/false - execute on each push countOnly: return count only on facet result grouping: { key: [groups] - goupings } };
Example usage
Execute on every push:
; ; ; ; //initialize the app and return the init facet panel and result data.;; ; console.logfilterResult.facet;console.logfilterResult.result; // cancel a selectionfilterResult = facet.push; console.logfilterResult.facet;console.logfilterResult.result; // reset to init statefilterResult = facet.reset;console.logfilterResult.facet;console.logfilterResult.result;
Execute only when called:
; ; ; ; //initialize the app and return the init facet panel and result data.;; facet.push; // You could push serval conditions in one time.facet.push;console.logfilterResult.facet;console.logfilterResult.result;
Passing a boolean as the second variable as push to overide the exceOnChange
setting
;