Cleanup : If a composable or function uses 2 or more items from a larger object, just pass in the whole object
enhancement2 - low/medium priority
### Pre-Flight checklist
- [x] Did you check to see if this issue already exists?
- [x] This is a single feature request. (Do not put multiple feature requests in one issue)
- [x] This is not a question or discussion. (Use https://lemmy.ml/c/jerboa for that)
### Describe The Feature Request Below
We have many cases where we've chosen to pass in the specific items that a composable needs.
You can look at a composable like like `CommunityScreen` to see how this has gotten:
<img height="300" alt="Image" src="https://github.com/user-attachments/assets/a4ac841c-1708-4277-91c9-6a07b1994421" />
It passes in 10 different appsettings, as well as the appsettingsviewmodel.
While its generally a good idea to pass params in atomically to prevent recompositions, for larger objects like `AppSettings` or `MyUserInfo`, or `LocalSite`, this has become quite tedious, and makes the number of params for functions very large. Those objects very rarely change (only when saving appsettings), so I don't think it makes sense anymore.
From now on, lets try to stick to a general rule of thumb, of passing in the larger objects if it uses 2 or more items from the same object.
This should also simplify refactors, as now changes to core objects won't to change tons of functions.
0 条评论