📄 useSorted¶
📊 Analysis Summary¶
| Metric | Count |
|---|---|
| 🔧 Functions | 3 |
| 📦 Imports | 6 |
| 🟢 Vue Composition API | 1 |
| 📐 Interfaces | 1 |
| 📑 Type Aliases | 2 |
📚 Table of Contents¶
🛠️ File Location:¶
📂 packages/core/useSorted/index.ts
📦 Imports¶
| Name | Source |
|---|---|
MaybeRefOrGetter |
vue |
Ref |
vue |
computed |
vue |
isRef |
vue |
toValue |
vue |
watchEffect |
vue |
Vue Composition API¶
| Name | Type | Reactive Variables | Composables |
|---|---|---|---|
computed |
computed | none | none |
Functions¶
useSorted(source: MaybeRefOrGetter<T[]>, compareFn: UseSortedCompareFn<T>): Ref<T[]>¶
reactive sort array
See: https://vueuse.org/useSorted
Code
defaultSortFn(source: T[], compareFn: UseSortedCompareFn<T>): T[]¶
Parameters:
sourceT[]compareFnUseSortedCompareFn<T>
Returns: T[]
Calls:
source.sort
defaultCompare(a: number, b: number): number¶
Parameters:
anumberbnumber
Returns: number
Interfaces¶
UseSortedOptions<T = any>¶
Interface Code
Properties¶
| Name | Type | Optional | Description |
|---|---|---|---|
sortFn |
UseSortedFn<T> |
✓ | not shown |
compareFn |
UseSortedCompareFn<T> |
✓ | not shown |
dirty |
boolean |
✓ | not shown |
Type Aliases¶
UseSortedCompareFn<T = any>¶
UseSortedFn<T = any>¶
Generated by Syntax Scribe