I will give you an impression what a lot of components look like.
We have a store, which communicates with an MQTT server. It handles reading data from it and keeping it cached (with WeakRef) for faster access. I also added that MQTT subscriptions are handled on-demand to reduce traffic. This frontend is going to run on weak hardware, so we definitely want to do these optimizations.
Now what he did with a lot of components is:
- Reading the same data as the store.
- Implementing the reading imperatively rather than reactively.
- Implementing it with fancy stuff like timeouts, a delay based on whether the connection to the MQTT server is online, a weird router hook construct to make sure the reading does happen, etc.
- It's like 1000 LOC which could've been 1 had he used the store.
- And all of these unnecessarily lines exist in other components. He didn't implementing it in a shared file for easy re-use.
