(sortFunction: NotesSortStrategy["sort"])
| 8 | }; |
| 9 | |
| 10 | const withPinned = (sortFunction: NotesSortStrategy["sort"]) => (a: Note, b: Note) => { |
| 11 | if (a.pinned && !b.pinned) return -1; |
| 12 | if (!a.pinned && b.pinned) return 1; |
| 13 | |
| 14 | return sortFunction(a, b); |
| 15 | }; |
| 16 | |
| 17 | const createdDate: NotesSortStrategy = { |
| 18 | sort: (a: Note, b: Note): number => { |