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

Update debugging/events into something simpler #29

Open
gingerchew opened this issue Aug 21, 2020 · 0 comments
Open

Update debugging/events into something simpler #29

gingerchew opened this issue Aug 21, 2020 · 0 comments
Labels
enhancement New feature or request
Milestone

Comments

@gingerchew
Copy link
Member

gingerchew commented Aug 21, 2020

Pub/Sub model is simple-ish, but the documentation of it is a little weird and keeping track of the multiple events is also clunky.

It might be worth it to refactor the way they are assigned, making a singular detail object:

{
	"form_selector": "ElementSelector<string>",
	"button_selector": "ElementSelector<string>",
	"difficulty": "number",
	"verification": "Verification[]",
	"msg": "string",
	"percent": "number",
	"done": "boolean",
}

This would remove the event prefix, but also the elements from the event detail. This way it can be passed on as a simple string. What I'm not sure of is how to pass on which form is which when there are multiple on a single page.

Some options that come to mind are:

  • a data-multiple attribute on the body tag
  • adding a data-whc-id attribute

The reason I'm hesitant to match it to an actual id attribute is because I want to decouple it as much from storing data in classes and ids as possible. They gave us data-* for a reason.

@gingerchew gingerchew added the enhancement New feature or request label Aug 21, 2020
@gingerchew gingerchew added this to the 2.0 milestone Aug 21, 2020
@gingerchew gingerchew changed the title Update debugging into something simpler Update debugging/events into something simpler Aug 21, 2020
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
None yet
Development

No branches or pull requests

1 participant