radio4000 / components

web-components to build the r4 interfaces, uses the sdk
https://components.radio4000.com/
1 stars 0 forks source link

Refactor with BaseQuery class #156

Closed oskarrough closed 1 year ago

oskarrough commented 1 year ago

I know we said we don't want more classes extending each other, but here is a try anyway to try and visualize the effects of it.

This avoids quite a bit of "complicated" logic being duplicated across pages and components, and now there's a clear path to follow when a page wants the query stuff.

Any component can now extend BaseQuery to get all the query goodness ready to go. Here's how:

Not sure this is the way, happy to hear any feedback. Now all the logic is basically inside these three, which could also be consolidated:

oskarrough commented 1 year ago

If a BaseQuery class is not the way, maybe back to dropping a few components in each page that needs it. Speaking together with events.

oskarrough commented 1 year ago

Well, it's still better extending a base class than duplicating the code everywhere we want the search/filters/pagination.