oppia / oppia-android

A free, online & offline learning platform to make quality education accessible for all.
https://www.oppia.org
Apache License 2.0
309 stars 509 forks source link

Add support for passing arbitrary data to ViewModels #191

Open BenHenning opened 4 years ago

BenHenning commented 4 years ago

This came up during one of @jamesxu0's PRs. In many situations, we want to pass data like IDs over to ViewModels however the current ViewModel factory pattern does not enable this. We should figure out how to pass arbitrary data to simplify ViewModel use and avoid tricky arrangement orders for the models.

BenHenning commented 1 year ago

FWIW I think this problem still exists, though injecting custom ViewModel factories (which we now do in a few places) might be the solution.