From db6f99011aafa231aefe8917695cc88609545a20 Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Wed, 25 Dec 2019 16:37:40 -0500 Subject: [PATCH] [+] Encapsulate get selectedArtworks() --- src/App.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/App.ts b/src/App.ts index ea76ed0..cbcd380 100644 --- a/src/App.ts +++ b/src/App.ts @@ -110,6 +110,14 @@ export default class App extends Vue this.artworks.sort((a, b) => b.date.getTime() - a.date.getTime()); } + /** + * Filter out artworks of selected type + */ + get selectedArtworks() + { + return this.artworks.filter(a => a.type.type == this.selectedType); + } + /** * Update on resize */