Add wcProp factory for web component property binding#469
Open
Piyush-t24 wants to merge 1 commit intoarmanbilge:mainfrom
Open
Add wcProp factory for web component property binding#469Piyush-t24 wants to merge 1 commit intoarmanbilge:mainfrom
Piyush-t24 wants to merge 1 commit intoarmanbilge:mainfrom
Conversation
25c91f5 to
0fbf956
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Web components expose their API through JS properties (el.value, el.disabled)
not HTML attributes, so setAttribute doesn't work for them.
Calico already has Prop[F,V,J] with all the right machinery, but there was no
public way to create one for an arbitrary property name outside of generated code.
This adds two methods to Html[F]:
def wcProp[V](name: String): Prop[F, V, V]
def wcProp[V, J](name: String, encode: V => J): Prop[F, V, J]
All existing Prop forms work automatically — :=, <--, Signal, Option variants.
Related to #37.