Skip to content

Update debugging/events into something simpler #29

@gingerchew

Description

@gingerchew

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions