feat: add get favorites

This commit is contained in:
thecodrr
2019-12-17 17:22:25 +05:00
parent 1c81034d57
commit 2e2258603a
2 changed files with 9 additions and 0 deletions

View File

@@ -55,6 +55,10 @@ class Database {
return extractValues(this.notes).reverse();
}
getFavorites() {
return tfun.filter(".favorite = true")(extractValues(this.notes));
}
/**
* Group notes by given criteria
* @param {string} by One from 'abc', 'month', 'year' or 'week'. Leave it empty for default grouping.