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
Add a StringDesc type that is a wrapper transform #62
Comments
As a convenience would be nice to also have:
This would let me shorten to:
|
Another alternative is just remove sealed from StringDesc and then I can do it on my own |
@dalewking hello! thanks for feedback! |
@dalewking hi! check this mergerequest - #71 |
I think it should work for what I want |
# Conflicts: # sample/mpp-library/src/commonMain/kotlin/com/icerockdev/library/Testing.kt
merged, will be released in 0.10.0 |
I have a case where I want to return something like a StringDesc to the UI so that it only has to call localized or toString(context) but where a transformation is ran on the result. The particular case is I have a String defining a date format and the transformation I want to run is use that format as an argument to a format call. I want to define that in common code so it does not know about loacalized or toString(context) and I don't want the code that receives it to have to call the format method.
I would try to define it myself but the fact that StringDesc is sealed makes that impossible
So what I am proposing is a map extension method on StringDesc. So I envision this in the common code:
So in StringDesc you would need a new class:
You would need extension methods on StringDesc:
And then the Android implementation might be:
The text was updated successfully, but these errors were encountered: