From 735f1d07eb9a7bd42bf63ff6be9682cdf9e11e02 Mon Sep 17 00:00:00 2001 From: Sam Carlton Date: Sat, 21 Nov 2020 16:01:31 -0600 Subject: [PATCH] Move list manipulation outside of compute --- pages/index.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 7074869..52ab9ec 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -61,6 +61,13 @@ function byTimeThenNull (appA, appB) { return appB.lastUpdated.timestamp - appA.lastUpdated.timestamp } +const sortedAppList = appList.sort(byTimeThenNull) + +const mergedList = [ + ...sortedAppList, + ...gameList +] + export default { components: { Search, @@ -73,10 +80,7 @@ export default { }, computed: { appList() { - return [ - ...appList.sort(byTimeThenNull), - ...gameList - ] + return mergedList } } }