Rules
"Rules" are static definitions that tell Finder how to interact with the unique shape of your Items objects. Finder will use that information to determine what internal state to track.
Each set of rules has a corresponding api to access and mutate their state.
Rule | API | Purpose |
---|---|---|
SearchRule | finder.search | Determine which properties in your Item should be searchable. |
FilterRule | finder.filter | Determine what filter predicates are required, and how they should be tested against your Items. |
SortByRule | finder.sortBy | determine what order your Items should be displayed in. |
GroupByRule | finder.groupBy | determine how to categorize your Items |
Rule Processing Order
- Search
- Filter
- SortBy
- Pagination
- GroupBy
tip
It may help to store rules as separate content files for easy re-use.
i.e: /Inventory/rules/filter-by-classification.ts