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

Add dedicated Key Type #41

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open

Add dedicated Key Type #41

wants to merge 12 commits into from

Conversation

robb
Copy link
Owner

@robb robb commented May 3, 2022

This adds a dedicated AttributeKey type and allows any Hashable value as an attribute value.

The idea being that this allows for safe storage of arbitrary data inside a node.

  • raw keys are meant for well-defined HTML attributes.
  • scoped keys should represent user-defined keys like data- or ng-.
  • .ephemeral keys are for associating short-lived data with elements, e.g. to tag them while passing them through middleware. .ephemeral will never be serialized.

Closes #28

@robb
Copy link
Owner Author

robb commented May 3, 2022

I guess what we want for values is AnyTextOutputStreamable, there isn't really a Hashable requirement…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant