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 Request] Hydrated blocs with different storages in the same app #1317

Closed
ncuillery opened this issue Jun 18, 2020 · 3 comments
Closed
Assignees
Labels
duplicate This issue or pull request already exists

Comments

@ncuillery
Copy link

Is your feature request related to a problem? Please describe.
I have some hydrated blocs that use the default temp folder (as a cache for my information coming the network: perform the fetching request only if the data is older than 12 hours).
But I also would like to use a hydrated bloc using the shared preferences storage to store my user preferences such as language, newsletter optin, etc.
I can't do that because, if I implement a custom storage in a BlocDelegate, all my blocs will use this storage.

Describe the solution you'd like
I guess one solution would be to not using BlocDelegate for implementing custom storage. Or improve the BlocSupervisor/BlocDelegate API to allow multiple BlocDelegates.

Additional context
I think I'd have the same problem if I already use a SimpleBlocDelegate for logging purpose and I want to write an other BlocDelegate for custom hydrated bloc storage.

@felangel
Copy link
Owner

Hi @ncuillery 👋
Thanks for opening an issue!

I moved this issue to the hydrated_bloc repository and will start brainstorming some potential solutions 👍

@felangel felangel self-assigned this Jun 19, 2020
@felangel felangel added the duplicate This issue or pull request already exists label Jun 19, 2020
@ncuillery
Copy link
Author

Thanks! Didn't realized hydrated_bloc has its own repo 🤦

@felangel
Copy link
Owner

No worries haha!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants