mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 15:09:33 +01:00
feat: sort all items by dateCreated
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import Indexer from "./indexer";
|
import Indexer from "./indexer";
|
||||||
|
import sort from "fast-sort";
|
||||||
|
|
||||||
export default class CachedCollection {
|
export default class CachedCollection {
|
||||||
constructor(context, type) {
|
constructor(context, type) {
|
||||||
@@ -65,9 +66,9 @@ export default class CachedCollection {
|
|||||||
|
|
||||||
getAllItems() {
|
getAllItems() {
|
||||||
let items = [];
|
let items = [];
|
||||||
for (let value of this.map.values()) {
|
this.map.forEach(value => {
|
||||||
items[items.length] = value;
|
items[items.length] = value;
|
||||||
}
|
});
|
||||||
return items;
|
return sort(items).desc(u => u.dateCreated);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user