Skip to content

Commit

Permalink
listings: albums/by-date: use withThingsSortedChronologically
Browse files Browse the repository at this point in the history
  • Loading branch information
towerofnix committed Jun 4, 2024
1 parent 3547fb6 commit 70d260f
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/listing-spec/wiki/albums/by-date.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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',
}),
],
};

0 comments on commit 70d260f

Please sign in to comment.