Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring TransactionViewModel #214

Closed
yash-k9 opened this issue Jan 2, 2022 · 1 comment · Fixed by #215
Closed

Refactoring TransactionViewModel #214

yash-k9 opened this issue Jan 2, 2022 · 1 comment · Fixed by #215
Assignees
Labels
enhancement New feature or request

Comments

@yash-k9
Copy link
Contributor

yash-k9 commented Jan 2, 2022

Is your feature request related to a problem? Please describe.
TransactionViewModel is extending AndroidViewModel which takes in application context and requires a viewmodelFactory to be initialized. In the viewmodel, I observed that only UiModeDataStore is using the application context which can be directly injected by Hilt

Describe the solution you'd like
Instead of using the AndroidViewModel, we can extend to ViewModel and Inject the UiModeDataStore directly through constructor. This will also eliminate the use of the viewmodelFactory

Describe alternatives you've considered
I've refactored the code and the behaviour is as expected. I can raise a PR if this change is approved.

@yash-k9 yash-k9 added the enhancement New feature or request label Jan 2, 2022
@Spikeysanju
Copy link
Owner

@yash-k9 Thanks for bringing this up. Yes I agreed with your statement. Feel free to create a PR for this 👍 .

@Spikeysanju Spikeysanju linked a pull request Jan 4, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants