I had a case when I needed to refactor code in my work. More precisely, I had to remove unnecessary libraries. One of these libraries created parallax effects when scrolling the page.
This library was used on many pages and in different ways. But it was poorly adaptive and complex to maintain or extend. For example, it didn't support 3d transformations, and for the only element on the site that required it, another library was installed.
Therefore, it was decided to write its directive, replacing both libraries and removing two dependencies at once. With the ability to extend the functionality and use in Vue 3.