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

[feature]: New ViewModel type #1051

Open
Fhenix96 opened this issue Nov 14, 2023 · 1 comment
Open

[feature]: New ViewModel type #1051

Fhenix96 opened this issue Nov 14, 2023 · 1 comment
Labels
new feature Requires planning and detailed comments of what will be done to build this p3

Comments

@Fhenix96
Copy link

Is your feature request related to a problem? Please describe.

I am using the cbl package and I often need to fetch or watch data in the couchbaseLite.
Also I am using Isar to save the user settings and sessions.

Now I have the Problem that I want to fetch the userSettings and also want to watch and fetch data in the couchbaseLite when opening the View.
This is currently not possible because there is no combination of the StreamViewModel and the FutureViewModel.

My current solution is that I fetch the userSettings in a View (route) before I open the desired View and pass them over.

I would like to have the opportunity to call Multiple Futures and Multiple Streams in a single ViewModel on initialise.

Describe the solution you would like

A new ViewModel that is a combination of the MultipleFutureViewModel and MultipleStreamViewModel.
When I open the View with this new type of ViewModel all Streams should be initialised and all Futures should be called and awaited.

There should be a streamsMap and a futuresMap just like as it is now.
The only difference is that "initialise" function calls all futures and initialises all streams.

I suggest the name "MultiDataSourceViewModel" but it is already used as a class name.

Additional Context

No response

@FilledStacks
Copy link
Contributor

Interesting idea, I think the better thing to do would be to allow you to use multiple ViewModels together.

We've attempted that before but it became very messy in the implementation and the use case was so small.

I would run the Future code manually in the ViewModel and use the StreamViewModel to listen to the data changes.

@FilledStacks FilledStacks added p3 new feature Requires planning and detailed comments of what will be done to build this labels Nov 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Requires planning and detailed comments of what will be done to build this p3
Projects
None yet
Development

No branches or pull requests

2 participants