mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-22 22:49:45 +01:00
fix: attach alias with tag for sorting/grouping
This commit is contained in:
@@ -47,11 +47,12 @@ export default class CachedCollection extends IndexedCollection {
|
||||
return Array.from(this.map.values());
|
||||
}
|
||||
|
||||
getItems(sortFn = (u) => u.dateCreated) {
|
||||
getItems(sortFn = (u) => u.dateCreated, manipulate = (item) => item) {
|
||||
let items = [];
|
||||
this.map.forEach((value) => {
|
||||
if (!value || value.deleted || !value.id) return;
|
||||
items[items.length] = value;
|
||||
value = manipulate ? manipulate(value) : value;
|
||||
items.push(value);
|
||||
});
|
||||
return sort(items).desc(sortFn);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user