justarrived / just-match-web

JustMatch Web
https://app.justarrived.se
5 stars 1 forks source link

Base component #478

Closed bex1 closed 7 years ago

bex1 commented 7 years ago

This is a start of a needed refactoring to clear all the userSubscriptions and systemLanguageSubscriptions from the code and provide all components with access to the user and system language via a base component class.

It will be adapted stepwise throughout the codebase without blocking progress.

It will likely save more than 1000 lines easily of repeated subscription handling code.

This will also replace the SystemLanguageListener class via the new systemLanguageChanged hook which will also provide us with more control than the old loadData hook.

It will remove the need of ever implementing lifecycle interfaces such as OnInit. Also by declaring new overridable empty functions one does not have to call super() when overriding (easily forgotten).

The refactoring will speed up development over time and will clear the only real concern I can see in the codebase going forward.

bex1 commented 7 years ago

@buren Any input on this? 👍 Will not go for the refactoring now. Can postpone it for some weeks easily since we have features to deliver 🚀