Skip to content

feat: allow params of factories to be used with watchValue and registerHandler#47

Open
Feichtmeier wants to merge 2 commits into
flutter-it:mainfrom
Feichtmeier:Feichtmeier/issue46
Open

feat: allow params of factories to be used with watchValue and registerHandler#47
Feichtmeier wants to merge 2 commits into
flutter-it:mainfrom
Feichtmeier:Feichtmeier/issue46

Conversation

@Feichtmeier

@Feichtmeier Feichtmeier commented Jun 13, 2026

Copy link
Copy Markdown

This pull request adds support for passing factory parameters when retrieving dependencies in the watchValue and registerHandler functions.
This makes it easier to watch factory "managers". But most importantly this enables handlers for (cached) factories

Here are examples with this change in my musicpod app:

With this I can remove the command map of getstationbyuuid in my radio manager:
grafik

and introduce a cached factory for stations as a manager with a single command:
grafik

Now I do not explicitely run the command in the station page because when the cached factory is instantiated with this uuid as a param the command is run:

grafik

and most imporantly I can now register handlers for this specific param.

Let me know if you like this or want any changes 🙇🏻

Closes #46

@codecov

codecov Bot commented Jun 13, 2026

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

ℹ️ You can also turn on project coverage checks and project coverage reporting on Pull Request comment

Thanks for integrating Codecov - We've got you covered ☂️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: add param1 to registerHandler and watchValue

1 participant