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

Use hiltViewModel for creating ViewModels with parameters in new Screen architecture #776

Merged
merged 3 commits into from
May 3, 2024

Conversation

rfc2822
Copy link
Member

@rfc2822 rfc2822 commented May 3, 2024

Purpose

Creation of ViewModels with parameters (@Assisted injection) is quite complicated now and involves code that can be dropped when using hiltViewModel().

Short description

This PR uses hiltViewModel() for creating such models for the screens that already have the new Screen/Model architecture and require parameters.

As soon as we switch to NavGraph, we'd have to use hiltViewModel() anyway.

Checklist

  • The PR has a proper title, description and label.
  • I have self-reviewed the PR.
  • I have added documentation to complex functions and functions that can be used by other modules.
  • I have added reasonable tests or consciously decided to not add tests.

@rfc2822 rfc2822 added the refactoring Internal improvement of existing functions label May 3, 2024
@rfc2822 rfc2822 self-assigned this May 3, 2024
@rfc2822 rfc2822 changed the title Use hiltViewModel for the new Screen usage Use hiltViewModel for creating ViewModels with parameters in new Screen architecture May 3, 2024
@rfc2822 rfc2822 marked this pull request as ready for review May 3, 2024 12:46
@rfc2822 rfc2822 merged commit e6eb908 into main-ose May 3, 2024
12 checks passed
@rfc2822 rfc2822 deleted the use-hiltviewmodel branch May 3, 2024 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Internal improvement of existing functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant