ryanw-mobile / OctoMeter

🔥Kotlin Multiplatform Desktop/Android/iOS Energy Tracker app
Other
126 stars 10 forks source link

Agile Screen and Usage Screen: Move partitioned cell calculation to ViewModel #251

Open ryanw-mobile opened 3 months ago

ryanw-mobile commented 3 months ago

Right now we split the data set according to the requested number of columns at composables and use remember to cache that. Obviously we use the UI thread for doing that, which can be avoided.

Moving the calculation back to ViewModel allows us to pick whichever dispatcher to do that, and we can include the results as a part of unit test (which in case we finally cover view model tests).

This is a low-priority work. Generally, it won't be done before we conclude this project in July 2024.