Video-Hub-App icon indicating copy to clipboard operation
Video-Hub-App copied to clipboard

Refactor sorting.pipe.ts

Open whyboris opened this issue 2 years ago • 2 comments

Seems like there is a lot of redundancy here: https://github.com/whyboris/Video-Hub-App/blob/main/src/app/pipes/sorting.pipe.ts#L196

Seems like I could create a dictionary from sortingType (e.g. timeAsc) to the sort property (e.g. duration) and reduce the whole if/then mess to a single "if in set of sortingType" perform the search with map.get("timeAsc") 🤔

ps - rename duplicateFinder.pipe.ts using kebab-case

whyboris avatar Sep 01 '23 17:09 whyboris

Hi, can i take this issue ?

NabilBouazzaoui avatar Sep 08 '23 15:09 NabilBouazzaoui

Thank you for the offer @NabilBouazzaoui 👍

I'm happy to answer any questions you have about making this change 🤝

If you write some code, feel free to submit your PR in whatever form you have - even partial work is a welcome contribution 😊

whyboris avatar Sep 09 '23 02:09 whyboris