-
Notifications
You must be signed in to change notification settings - Fork 9
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
SetAttrs should take Elem as argument #199
Conversation
Hi @pawelkaczor thanks for your contribution! Let me check your proposal, could you please add more details and examples(so we can add also some documentation about it) in the meanwhile? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add documentation
Hi @geirolz. I would rather treat this issue as a "missing feature". Imagine you just want to update a value of an existing attribute (like value = value + 1). How can I accomplish this with advxml? |
Concrete example: private val dataAgeAttrAddition: ComposableXmlModifier =
SetAttr(attrs => {
val age = DataAge(Instant.parse(attrs \@ "CREATED_AT"), clock.instant)
k"DATA_AGE" := age.asString
})
|
Good point, I agree. It is achievable but with some workaround. If it does we can introduce something new like |
A new constructor method has been added to the API. This is not a breaking change. |
Codecov Report
@@ Coverage Diff @@
## master #199 +/- ##
==========================================
- Coverage 99.42% 99.11% -0.32%
==========================================
Files 21 21
Lines 347 338 -9
==========================================
- Hits 345 335 -10
- Misses 2 3 +1
Continue to review full report at Codecov.
|
@pawelkaczor if you can add some tests for this then we can merge it! Please check |
Done. Not sure if the test fails because of my change? |
Looks like the tests were failing before my changes. |
Yes, no problem I'm going to fix it, one done I merge. Thanks again for the contribution! |
@pawelkaczor merged! Just added you as a contributor in the readme file, thanks again! |
No description provided.