Hello :-)
> About keeping a single subscription in the repo
I wrote "single subscription TO repository.getDataFlow()". So in the view model, one'd collect inside init block as in your original example. And refresh() method would instead be doing some call in the repository and in the repository you'd perform refresh, which would simply return new data into the already open `getDataFlow()`.
But as I said in my comment, this really depends on what is the implementation of the repository.
For example if the `getDataFlow()` always returns a new Flow, then what I'm saying is of course not possible.
One might also ask a question, why does `getDataFlow()` always return a new Flow and why isn't one Flow instead used in the Repository -> which will greatly depend on what is the actual use case.
Perhaps a question should also be asked, whether Flow even should be used in the first place and whether a suspending function wouldn't be more appropriate.
Flow is useful when one expects multiple events, but for a one-off request, that only ever return a value once, suspending function would be more appropriate. That way there's no need to do any collection of any flow and code is also quite simple to read.
But this is all just hypothetical and at the end of the day, each application has its own context that should be used to determine what is appropriate or not.