From 70d260f1025c483800a1c3436e427eedfa21c16c Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Tue, 4 Jun 2024 15:01:43 -0300 Subject: [PATCH] listings: albums/by-date: use withThingsSortedChronologically --- src/listing-spec/wiki/albums/by-date.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/listing-spec/wiki/albums/by-date.js b/src/listing-spec/wiki/albums/by-date.js index f12d039bf..44ed3addb 100644 --- a/src/listing-spec/wiki/albums/by-date.js +++ b/src/listing-spec/wiki/albums/by-date.js @@ -1,7 +1,8 @@ import {input} from '#composite'; -import {sortChronologically} from '#sort'; -import {exitWithoutDependency} from '#composite/control-flow'; +import {exposeDependency, exitWithoutDependency} + from '#composite/control-flow'; +import {withThingsSortedChronologically} from '#composite/wiki-data'; export default { scope: 'wiki', @@ -21,11 +22,12 @@ export default { value: input.value([]), }), - { - dependencies: ['albumData'], - compute: ({albumData}) => - sortChronologically( - albumData.filter(album => album.date)), - }, + withThingsSortedChronologically({ + things: 'albumData', + }), + + exposeDependency({ + dependency: '#sortedThings', + }), ], };