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] Add converter to StoreBuilder #554

Closed
matt-ramotar opened this issue May 21, 2023 · 7 comments · Fixed by #594
Closed

[Feature Request] Add converter to StoreBuilder #554

matt-ramotar opened this issue May 21, 2023 · 7 comments · Fixed by #594
Labels
enhancement New feature or request

Comments

@matt-ramotar
Copy link
Collaborator

Some of the samples demonstrate adding a converter via a StoreBuilder but it looks like that's only possible from MutableStoreBuilder now, is that right?

https://www.reddit.com/r/androiddev/comments/13mb2sz/comment/jkzutgk/?utm_source=share&utm_medium=web2x&context=3

RealStore uses the concept of converter but currently it's only possible to configure using MutableStoreBuilder

@matt-ramotar matt-ramotar added the enhancement New feature or request label May 21, 2023
@github-project-automation github-project-automation bot moved this to 🆕 Triage in Store Roadmap May 21, 2023
@digitalbuddha
Copy link
Contributor

Maybe storebuilder.withConverter?

@SteinerOk
Copy link

SteinerOk commented May 21, 2023

I would like to add a comment as I think this is my case.

Now I am using Store4 and the SourceOfTruth interface in it has the following signature: SourceOfTruth<Key, Input, Output>, which allows me to use different types of reading and writing in SourceOfTruth (When I receive data from the network, I modify it and write it to the database, but for reading I already get a different type (a complex combined query in the database), but there is no such possibility in Store5, due to its signature for SourceOfTruth is SourceOfTruth<Key : Any, Local : Any>), which does not allow switching to it.

Could a potential Converter cover this case?

Update:
Although I really thought this is not the case when the converter will help ...
I don't need to convert the network object to a SOT object, I just need to be able to "work" with the network model in the SOT write method...

@inktomi
Copy link

inktomi commented Jun 9, 2023

The documentation shows this as being included already, but as of 5.0.0-beta1 it's not. Note in the docs the return type is MutableStore yet the builder used is StoreBuilder.

https://mobilenativefoundation.github.io/Store/mutable-store/building/builder/

@digitalbuddha
Copy link
Contributor

digitalbuddha commented Jun 10, 2023

Hello! apologies for this breaking change, I'm at a conference this week but will take a look over weekend/next week. I think this was an unintended breaking change from an alpha where we had mutable store being a behavior of store rather than a proxy that you wrap a store with. I'll touch base with other maintainer and figure out a path forward. Apologies for the mess :-)

@wbrawner
Copy link
Contributor

wbrawner commented Dec 8, 2023

Hey, any updates here? I'd be happy to contribute this if no one else is already working on it

@digitalbuddha
Copy link
Contributor

I don't believe anyone is and contributions are incredibly appreciated

@wbrawner
Copy link
Contributor

wbrawner commented Dec 8, 2023

Awesome, I'll pick this up then

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

5 participants